diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-22 09:46:35 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-03-22 09:46:35 (GMT) |
commit | e9ddbf65a87d37c81cad5ea1369ea8b2202e7701 (patch) | |
tree | 2d1aec3a2b273a22082b52e2a6f28fb4ecad3134 /Python | |
parent | 0a4edd5435d30e49958b1c1e433ea3b4aa8da324 (diff) | |
download | cpython-e9ddbf65a87d37c81cad5ea1369ea8b2202e7701.zip cpython-e9ddbf65a87d37c81cad5ea1369ea8b2202e7701.tar.gz cpython-e9ddbf65a87d37c81cad5ea1369ea8b2202e7701.tar.bz2 |
Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395
Diffstat (limited to 'Python')
-rw-r--r-- | Python/import.c | 5 |
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; |