commit | e9ddbf65a87d37c81cad5ea1369ea8b2202e7701 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Tue Mar 22 10:46:35 2011 +0100 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Tue Mar 22 10:46:35 2011 +0100 |
tree | 2d1aec3a2b273a22082b52e2a6f28fb4ecad3134 | |
parent | 0a4edd5435d30e49958b1c1e433ea3b4aa8da324 [diff] [blame] |
Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395
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 @@ 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;