mirror of
https://github.com/python/cpython.git
synced 2026-04-14 15:50:50 +00:00
gh-146355: Fix main_module ref leak in _PyRun_SimpleStringFlagsWithName (#146356)
This commit is contained in:
parent
f2fcc49467
commit
08f6b33bf3
1 changed files with 1 additions and 0 deletions
|
|
@ -567,6 +567,7 @@ _PyRun_SimpleStringFlagsWithName(const char *command, const char* name, PyCompil
|
|||
PyObject* the_name = PyUnicode_FromString(name);
|
||||
if (!the_name) {
|
||||
PyErr_Print();
|
||||
Py_DECREF(main_module);
|
||||
return -1;
|
||||
}
|
||||
res = _PyRun_StringFlagsWithName(command, the_name, Py_file_input, dict, dict, flags, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue