From: Richard Oudkerk Date: Mon, 10 Jun 2013 14:38:54 +0000 (+0100) Subject: Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows(). X-Git-Tag: v3.4.0a1~538^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=409f90237c07d2365f6e0b527071e74415c073f3;p=thirdparty%2FPython%2Fcpython.git Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows(). --- diff --git a/Misc/NEWS b/Misc/NEWS index 58ae9ba469db..a204bb3c12cf 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,8 @@ What's New in Python 3.3.3 release candidate 1? Core and Builtins ----------------- +- Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows(). + - Issue #18038: SyntaxError raised during compilation sources with illegal encoding now always contains an encoding name. diff --git a/Python/dynload_win.c b/Python/dynload_win.c index edb6038e3bfb..ffcf0ee1d739 100644 --- a/Python/dynload_win.c +++ b/Python/dynload_win.c @@ -262,8 +262,9 @@ dl_funcptr _PyImport_GetDynLoadWindows(const char *shortname, theLength)); } if (message != NULL) { - PyErr_SetImportError(message, PyUnicode_FromString(shortname), - pathname); + PyObject *shortname_obj = PyUnicode_FromString(shortname); + PyErr_SetImportError(message, shortname_obj, pathname); + Py_XDECREF(shortname_obj); Py_DECREF(message); } return NULL;