mirror of
https://github.com/python/cpython.git
synced 2025-08-28 20:56:54 +00:00
[3.12] Fix possible refleak in CodeType.replace() (GH-106243) (GH-106244)
Fix possible refleak in CodeType.replace() (GH-106243)
A reference to c_code was leaked if PySys_Audit() failed.
(cherry picked from commit 3c70d467c1
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
c9b9555650
commit
2405929c35
1 changed files with 1 additions and 0 deletions
|
@ -2030,6 +2030,7 @@ code_replace_impl(PyCodeObject *self, int co_argcount,
|
|||
co_code, co_filename, co_name, co_argcount,
|
||||
co_posonlyargcount, co_kwonlyargcount, co_nlocals,
|
||||
co_stacksize, co_flags) < 0) {
|
||||
Py_XDECREF(code);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue