Mercurial > cpython-lru_cache-weakref
diff Python/import.c @ 68826:3114f26d5d54
Issue #11630, issue #3080: Fix refleak introduced by ef2b6305d395
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Tue, 22 Mar 2011 10:46:35 +0100 |
| parents | 15f9eca5e956 |
| children | 5deb2094f033 |
line wrap: on
line diff
--- a/Python/import.c Mon Mar 21 17:54:04 2011 -0700 +++ b/Python/import.c Tue Mar 22 10:46:35 2011 +0100 @@ -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;
