]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-35303: Fix a reference leak in _operator.c's methodcaller_repr(). (GH-10689)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 23 Nov 2018 19:58:25 +0000 (11:58 -0800)
committerGitHub <noreply@github.com>
Fri, 23 Nov 2018 19:58:25 +0000 (11:58 -0800)
(cherry picked from commit 5b83ef71d3060e1651d3680e805f13a1049c7d6d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Modules/_operator.c

index fb8eafc6793d703b7f9004e30ccc70f93e95fbfa..af05f1c296bdb393fe78a7baed95e504ecc5daac 100644 (file)
@@ -1057,6 +1057,7 @@ methodcaller_repr(methodcallerobject *mc)
                 goto done;
             if (i >= numtotalargs) {
                 i = -1;
+                Py_DECREF(onerepr);
                 break;
             }
             PyTuple_SET_ITEM(argreprs, i, onerepr);