From 9883ca498d654a4792d530bd8d6d64fef4dc971c Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 11 Oct 2021 11:57:27 +0300 Subject: [PATCH] Fix a leak in _PyImport_LoadDynamicModuleWithSpec() after failing PySys_Audit() (GH-28862) --- Python/importdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/importdl.c b/Python/importdl.c index 1847eba74ae..27ffc642840 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