mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Issue #14761: Fix potential leak on an error case in the import machinery.
This commit is contained in:
@@ -998,7 +998,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
|
||||
FILE *fpc;
|
||||
char *buf;
|
||||
char *cpathname;
|
||||
PyCodeObject *co;
|
||||
PyCodeObject *co = NULL;
|
||||
PyObject *m;
|
||||
|
||||
if (fstat(fileno(fp), &st) != 0) {
|
||||
@@ -1054,6 +1054,7 @@ load_source_module(char *name, char *pathname, FILE *fp)
|
||||
return m;
|
||||
|
||||
error_exit:
|
||||
Py_XDECREF(co);
|
||||
PyMem_FREE(buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user