]> 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:46 +0000 (13:13 -0400)
committerGitHub <noreply@github.com>
Sun, 26 Aug 2018 17:13:46 +0000 (13:13 -0400)
(cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856)

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

index 78c0524a1d8a2ad7dbdd8a555ba2d1356ba49a89..a08936dda8732d2f6058eb54a5877b4a3068bf6f 100644 (file)
@@ -97,6 +97,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;
             }