]> 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:43:09 +0000 (02:43 -0700)
committerGitHub <noreply@github.com>
Mon, 11 Oct 2021 09:43:09 +0000 (02:43 -0700)
(cherry picked from commit 9883ca498d654a4792d530bd8d6d64fef4dc971c)

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

index fbeb9fb75403e608d01de02ad6e7c8df389043bb..b197dfeaef8053cdc295fc5948b96c8dbfc471b6 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