![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
https://hg.python.org/cpython/rev/94471357db08 changeset: 101196:94471357db08 parent: 101194:5b5fbce1db9c parent: 101195:5871b48f4c2e user: Berker Peksag <berker.peksag@gmail.com> date: Sun May 01 09:06:57 2016 +0300 summary: Issue #23960: Cleanup args and kwargs on error in PyErr_SetImportError Patch by Ofer Schwarz. files: Python/errors.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Python/errors.c b/Python/errors.c --- a/Python/errors.c +++ b/Python/errors.c @@ -727,9 +727,9 @@ PyTuple_SET_ITEM(args, 0, msg); if (PyDict_SetItemString(kwargs, "name", name) < 0) - return NULL; + goto done; if (PyDict_SetItemString(kwargs, "path", path) < 0) - return NULL; + goto done; error = PyObject_Call(PyExc_ImportError, args, kwargs); if (error != NULL) { @@ -737,9 +737,9 @@ Py_DECREF(error); } +done: Py_DECREF(args); Py_DECREF(kwargs); - return NULL; } -- Repository URL: https://hg.python.org/cpython