]> granicus.if.org Git - python/commitdiff
Correct a refleak found by "regrtest.py -R:: test_structmembers"
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 14 Apr 2008 20:07:48 +0000 (20:07 +0000)
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>
Mon, 14 Apr 2008 20:07:48 +0000 (20:07 +0000)
Some other minor updates in _warnings.c:
- make a function static
- rename a shadowing local variable

Python/_warnings.c

index dc333439b3d41d525b55924e262064a6b9bbf2fc..bb688b1be0347a73e52225bf9e88eadd235c4b55 100644 (file)
@@ -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;
         }
     }