summaryrefslogtreecommitdiff
path: root/Python/dynload_win.c
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-06-10 15:38:54 +0100
committerRichard Oudkerk <shibturn@gmail.com>2013-06-10 15:38:54 +0100
commitfcee680568a96717bd23a8157fbdae945365c6e8 (patch)
treeb37205c72414f0fe369cb8b74f9dd94b7560fe67 /Python/dynload_win.c
parent620ee6a7e6d77329cb4d48268ba0676a9bbe1ff5 (diff)
downloadcpython-fcee680568a96717bd23a8157fbdae945365c6e8.tar.gz
Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
Diffstat (limited to 'Python/dynload_win.c')
-rw-r--r--Python/dynload_win.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/dynload_win.c b/Python/dynload_win.c
index edb6038e3b..ffcf0ee1d7 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;