From 2caf86ff6d72d625f86db78c6e90fdaf09e8f703 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sun, 26 Aug 2018 13:13:47 -0400 Subject: [PATCH] bpo-34503: Fix refleak in PyErr_SetObject() (GH-8934) (cherry picked from commit a2eefa67542c25617a58c03a27c17fd48e2a0856) Co-authored-by: Alexey Izbyshev --- Python/errors.c | 1 + 1 file changed, 1 insertion(+) diff --git a/Python/errors.c b/Python/errors.c index 15e6ba05714..8c8ea1cd577 100644 --- a/Python/errors.c +++ b/Python/errors.c @@ -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; }