From d57d33c2342f8ebaf9a91fe991dbfc148340e811 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Mon, 11 Oct 2021 02:43:09 -0700 Subject: Fix a leak in _PyImport_LoadDynamicModuleWithSpec() after failing PySys_Audit() (GH-28862) (cherry picked from commit 9883ca498d654a4792d530bd8d6d64fef4dc971c) Co-authored-by: Serhiy Storchaka --- Python/importdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python') diff --git a/Python/importdl.c b/Python/importdl.c index fbeb9fb754..b197dfeaef 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -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 -- cgit v1.2.1