]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-87849: Fix refleak in SEND instruction. (GH-101908)
authorMark Shannon <mark@hotpy.org>
Wed, 15 Feb 2023 12:21:40 +0000 (12:21 +0000)
committerGitHub <noreply@github.com>
Wed, 15 Feb 2023 12:21:40 +0000 (12:21 +0000)
Fix refleak in SEND instruction.

Python/bytecodes.c
Python/generated_cases.c.h

index be54e5f6f589eb95ad745e9b7c22d617c471ce18..d5d5034cbfbf74bfe484c0015fb44174a0d778ce 100644 (file)
@@ -727,6 +727,7 @@ dummy_func(
             else {
                 assert(retval != NULL);
             }
+            Py_DECREF(v);
         }
 
         inst(SEND_GEN, (unused/1, receiver, v -- receiver)) {
index beb797cbd233d7d45d5a109dbc2de186dcb90bf0..8b8a7161ad898ef4089ac1c94f7a75e48e4f26d2 100644 (file)
             else {
                 assert(retval != NULL);
             }
+            Py_DECREF(v);
             POKE(1, retval);
             JUMPBY(1);
             DISPATCH();