summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/import.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 1d3a485..598b7e0 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -1293,7 +1293,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
FILE *fpc;
char *buf;
char *cpathname;
- PyCodeObject *co;
+ PyCodeObject *co = NULL;
PyObject *m;
if (fstat(fileno(fp), &st) != 0) {
@@ -1350,6 +1350,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
return m;
error_exit:
+ Py_XDECREF(co);
PyMem_FREE(buf);
return NULL;
}