]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395
authorVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Mar 2011 09:46:35 +0000 (10:46 +0100)
committerVictor Stinner <victor.stinner@haypocalc.com>
Tue, 22 Mar 2011 09:46:35 +0000 (10:46 +0100)
Python/import.c

index 3b8ce931d9e33aeaaa2f7eedcb58502779358bd7..907ccd797ccf7d9fd5ded12db7625d39f7daea4b 100644 (file)
@@ -3705,12 +3705,15 @@ imp_load_dynamic(PyObject *self, PyObject *args)
         return NULL;
     if (fob != NULL) {
         fp = get_file(NULL, fob, "r");
-        if (fp == NULL)
+        if (fp == NULL) {
+            Py_DECREF(pathname);
             return NULL;
+        }
     }
     else
         fp = NULL;
     mod = _PyImport_LoadDynamicModule(name, pathname, fp);
+    Py_DECREF(pathname);
     if (fp)
         fclose(fp);
     return mod;