bpo-34503: Fix refleak in PyErr_SetObject() (GH-8934)

(cherry picked from commit a2eefa6754)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
This commit is contained in:
Miss Islington (bot) 2018-08-26 13:13:47 -04:00 committed by GitHub
parent d6725fcdd5
commit 2caf86ff6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -110,6 +110,7 @@ PyErr_SetObject(PyObject *exception, PyObject *value)
fixed_value = _PyErr_CreateException(exception, value); fixed_value = _PyErr_CreateException(exception, value);
Py_XDECREF(value); Py_XDECREF(value);
if (fixed_value == NULL) { if (fixed_value == NULL) {
Py_DECREF(exc_value);
return; return;
} }