[Python-checkins] cpython: Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395

victor.stinner python-checkins at python.org
Tue Mar 22 10:47:09 CET 2011


http://hg.python.org/cpython/rev/3114f26d5d54
changeset:   68826:3114f26d5d54
user:        Victor Stinner <victor.stinner at haypocalc.com>
date:        Tue Mar 22 10:46:35 2011 +0100
summary:
  Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395

files:
  Python/import.c

diff --git a/Python/import.c b/Python/import.c
--- a/Python/import.c
+++ b/Python/import.c
@@ -3705,12 +3705,15 @@
         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;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list