[Python-checkins] GH-87849: Fix refleak in SEND instruction. (GH-101908)

markshannon webhook-mailer at python.org
Wed Feb 15 07:22:20 EST 2023


https://github.com/python/cpython/commit/c7766245c14fa03b8afd3aff9be30b13d0069f95
commit: c7766245c14fa03b8afd3aff9be30b13d0069f95
branch: main
author: Mark Shannon <mark at hotpy.org>
committer: markshannon <mark at hotpy.org>
date: 2023-02-15T12:21:40Z
summary:

GH-87849: Fix refleak in SEND instruction. (GH-101908)

Fix refleak in SEND instruction.

files:
M Python/bytecodes.c
M Python/generated_cases.c.h

diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index be54e5f6f589..d5d5034cbfbf 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -727,6 +727,7 @@ dummy_func(
             else {
                 assert(retval != NULL);
             }
+            Py_DECREF(v);
         }
 
         inst(SEND_GEN, (unused/1, receiver, v -- receiver)) {
diff --git a/Python/generated_cases.c.h b/Python/generated_cases.c.h
index beb797cbd233..8b8a7161ad89 100644
--- a/Python/generated_cases.c.h
+++ b/Python/generated_cases.c.h
@@ -934,6 +934,7 @@
             else {
                 assert(retval != NULL);
             }
+            Py_DECREF(v);
             POKE(1, retval);
             JUMPBY(1);
             DISPATCH();



More information about the Python-checkins mailing list