summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/codeobject.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c
index 9b54c61..d47ca73 100644
--- a/Objects/codeobject.c
+++ b/Objects/codeobject.c
@@ -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;
}