]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix a potential reference-counting bug in long_pow (GH-26690) (#26702)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 13 Jun 2021 07:42:43 +0000 (00:42 -0700)
committerGitHub <noreply@github.com>
Sun, 13 Jun 2021 07:42:43 +0000 (08:42 +0100)
(cherry picked from commit 59242431991794064824cf2ab70886367613f29e)

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

index 0ff0e80cd4269686b0330dcaafc010d3c266a797..cf13b2c4301778dc6107608a6b3f4d9108c0958a 100644 (file)
@@ -4312,6 +4312,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: