Skip to content

Commit 08f6b33

Browse files
authored
gh-146355: Fix main_module ref leak in _PyRun_SimpleStringFlagsWithName (#146356)
1 parent f2fcc49 commit 08f6b33

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Python/pythonrun.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ _PyRun_SimpleStringFlagsWithName(const char *command, const char* name, PyCompil
567567
PyObject* the_name = PyUnicode_FromString(name);
568568
if (!the_name) {
569569
PyErr_Print();
570+
Py_DECREF(main_module);
570571
return -1;
571572
}
572573
res = _PyRun_StringFlagsWithName(command, the_name, Py_file_input, dict, dict, flags, 0);

0 commit comments

Comments
 (0)