]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a leak in _PyImport_LoadDynamicModuleWithSpec() after failing PySys_Audit() ...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 11 Oct 2021 09:22:29 +0000 (02:22 -0700)
committerGitHub <noreply@github.com>
Mon, 11 Oct 2021 09:22:29 +0000 (02:22 -0700)
(cherry picked from commit 9883ca498d654a4792d530bd8d6d64fef4dc971c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Python/importdl.c

index 1847eba74aef45ce241bd13b2b262e45898fc9c3..27ffc64284098e6e8e2435a842264a9be202587a 100644 (file)
@@ -121,7 +121,7 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
 
     if (PySys_Audit("import", "OOOOO", name_unicode, path,
                     Py_None, Py_None, Py_None) < 0) {
-        return NULL;
+        goto error;
     }
 
 #ifdef MS_WINDOWS