Correct a refleak found by "regrtest.py -R:: test_structmembers"

Some other minor updates in _warnings.c:
- make a function static
- rename a shadowing local variable
This commit is contained in:
Amaury Forgeot d'Arc 2008-04-14 20:07:48 +00:00
parent 14d6b0f8f0
commit f9e7ebe165

View file

@ -61,7 +61,7 @@ get_warnings_attr(const char *attr)
} }
PyObject * static PyObject *
get_once_registry(void) get_once_registry(void)
{ {
PyObject *registry; PyObject *registry;
@ -378,16 +378,17 @@ warn_explicit(PyObject *category, PyObject *message,
show_warning(filename, lineno, text, category, sourceline); show_warning(filename, lineno, text, category, sourceline);
} }
else { else {
PyObject *result; PyObject *res;
result = PyObject_CallFunctionObjArgs(show_fxn, message, category, res = PyObject_CallFunctionObjArgs(show_fxn, message, category,
filename, lineno_obj, filename, lineno_obj,
Py_None, Py_None,
sourceline ? sourceline ?
sourceline: Py_None, sourceline: Py_None,
NULL); NULL);
Py_XDECREF(result); Py_DECREF(show_fxn);
if (result == NULL) Py_XDECREF(res);
if (res == NULL)
goto cleanup; goto cleanup;
} }
} }