bpo-46430: Fix memory leak in interned strings of deep-frozen modules (GH-31549)

This commit is contained in:
Kumar Aditya 2022-02-24 22:24:06 +05:30 committed by GitHub
parent 042f31da55
commit 4dc746310b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 21 additions and 6 deletions

View file

@ -754,7 +754,6 @@ pycore_init_types(PyInterpreterState *interp)
if (_PyStatus_EXCEPTION(status)) {
return status;
}
return _PyStatus_OK();
}
@ -827,7 +826,10 @@ pycore_interp_init(PyThreadState *tstate)
if (_PyStatus_EXCEPTION(status)) {
return status;
}
// Intern strings in deep-frozen modules first so that others
// can use it instead of creating a heap allocated string.
_Py_Deepfreeze_Init();
status = pycore_init_types(interp);
if (_PyStatus_EXCEPTION(status)) {
goto done;