]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.10] Fix a potential reference-counting bug in long_pow (GH-26690) (GH-26703)
authorMark Dickinson <mdickinson@enthought.com>
Sun, 13 Jun 2021 07:58:32 +0000 (08:58 +0100)
committerGitHub <noreply@github.com>
Sun, 13 Jun 2021 07:58:32 +0000 (08:58 +0100)
(cherry picked from commit 59242431991794064824cf2ab70886367613f29e)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
Objects/longobject.c

index e1c1191e648daedbb6c44f88118c43a638834d7a..685bd56096f486acbe458d88b43807b7d74f20aa 100644 (file)
@@ -4185,6 +4185,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
                 goto Error;
             Py_DECREF(a);
             a = temp;
+            temp = NULL;
         }
 
         /* Reduce base by modulus in some cases: