From 66f3659c9e3f1103426bee64c1cc950025e97ade Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Mon, 9 Jul 2012 22:21:55 -0700 Subject: fix refleak --- Python/import.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- cgit v0.12