summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-03-22 09:46:35 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-03-22 09:46:35 (GMT)
commite9ddbf65a87d37c81cad5ea1369ea8b2202e7701 (patch)
tree2d1aec3a2b273a22082b52e2a6f28fb4ecad3134 /Python/import.c
parent0a4edd5435d30e49958b1c1e433ea3b4aa8da324 (diff)
downloadcpython-e9ddbf65a87d37c81cad5ea1369ea8b2202e7701.zip
cpython-e9ddbf65a87d37c81cad5ea1369ea8b2202e7701.tar.gz
cpython-e9ddbf65a87d37c81cad5ea1369ea8b2202e7701.tar.bz2
Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 3b8ce93..907ccd7 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -3705,12 +3705,15 @@ imp_load_dynamic(PyObject *self, PyObject *args)
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;