]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
authorRichard Oudkerk <shibturn@gmail.com>
Mon, 10 Jun 2013 14:38:54 +0000 (15:38 +0100)
committerRichard Oudkerk <shibturn@gmail.com>
Mon, 10 Jun 2013 14:38:54 +0000 (15:38 +0100)
Misc/NEWS
Python/dynload_win.c

index 58ae9ba469dbe217df4a9e0849eabe5e8b3dc478..a204bb3c12cf2823ea106147378dddcdf26406ce 100644 (file)
--- 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.
 
index edb6038e3bfb55cb26f4eb2b033715e24368d5b3..ffcf0ee1d7392cb9ad6ccca0441f275a3d5c4ae6 100644 (file)
@@ -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;