]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-34503: Fix refleak in PyErr_SetObject() (GH-8934)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 26 Aug 2018 17:13:47 +0000 (13:13 -0400)
committerGitHub <noreply@github.com>
Sun, 26 Aug 2018 17:13:47 +0000 (13:13 -0400)
(cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Python/errors.c

index 15e6ba057143371ff08ba07120ee5b76384ae688..8c8ea1cd5772b562ebe3f4fd2ca9f45d00620082 100644 (file)
@@ -110,6 +110,7 @@ PyErr_SetObject(PyObject *exception, PyObject *value)
             fixed_value = _PyErr_CreateException(exception, value);
             Py_XDECREF(value);
             if (fixed_value == NULL) {
+                Py_DECREF(exc_value);
                 return;
             }