diff Python/import.c @ 78048:3fa1414ce505

fix refleak
author Benjamin Peterson <benjamin@python.org>
date Mon, 09 Jul 2012 22:21:55 -0700
parents 7ed3b4f830c0
children 2ecdda96f970
line wrap: on
line diff
--- a/Python/import.c	Tue Jul 10 07:07:06 2012 +0200
+++ b/Python/import.c	Mon Jul 09 22:21:55 2012 -0700
@@ -431,7 +431,9 @@
                                                  "_RAW_MAGIC_NUMBER");
     if (pyc_magic == NULL)
         return -1;
-    return PyLong_AsLong(pyc_magic);
+    long res = PyLong_AsLong(pyc_magic);
+    Py_DECREF(pyc_magic);
+    return res;
 }