summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-14 20:07:48 (GMT)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-04-14 20:07:48 (GMT)
commitf9e7ebe165215c8eadd16c7988c5d20c0d114cf5 (patch)
tree9c33e337c8b83f193a8fd39a3a4875ad55bf8b80 /Python
parent14d6b0f8f0b2f467ec38fc8a08af8dc9eeb4ef20 (diff)
downloadcpython-f9e7ebe165215c8eadd16c7988c5d20c0d114cf5.zip
cpython-f9e7ebe165215c8eadd16c7988c5d20c0d114cf5.tar.gz
cpython-f9e7ebe165215c8eadd16c7988c5d20c0d114cf5.tar.bz2
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
Diffstat (limited to 'Python')
-rw-r--r--Python/_warnings.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index dc33343..bb688b1 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -61,7 +61,7 @@ get_warnings_attr(const char *attr)
}
-PyObject *
+static PyObject *
get_once_registry(void)
{
PyObject *registry;
@@ -378,16 +378,17 @@ warn_explicit(PyObject *category, PyObject *message,
show_warning(filename, lineno, text, category, sourceline);
}
else {
- PyObject *result;
+ PyObject *res;
- result = PyObject_CallFunctionObjArgs(show_fxn, message, category,
+ res = PyObject_CallFunctionObjArgs(show_fxn, message, category,
filename, lineno_obj,
Py_None,
sourceline ?
sourceline: Py_None,
NULL);
- Py_XDECREF(result);
- if (result == NULL)
+ Py_DECREF(show_fxn);
+ Py_XDECREF(res);
+ if (res == NULL)
goto cleanup;
}
}