mirror of https://github.com/python/cpython
Fix possible refleak in CodeType.replace() (GH-106243)
A reference to c_code was leaked if PySys_Audit() failed.
This commit is contained in:
parent
fb0d9b9ac1
commit
3c70d467c1
|
@ -2035,6 +2035,7 @@ code_replace_impl(PyCodeObject *self, int co_argcount,
|
||||||
co_code, co_filename, co_name, co_argcount,
|
co_code, co_filename, co_name, co_argcount,
|
||||||
co_posonlyargcount, co_kwonlyargcount, co_nlocals,
|
co_posonlyargcount, co_kwonlyargcount, co_nlocals,
|
||||||
co_stacksize, co_flags) < 0) {
|
co_stacksize, co_flags) < 0) {
|
||||||
|
Py_XDECREF(code);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue