summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Python/import.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 4ae8abf..aeaa9c0 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -431,7 +431,9 @@ PyImport_GetMagicNumber(void)
"_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;
}