diff options
| author | Richard Oudkerk <shibturn@gmail.com> | 2013-06-10 15:38:54 +0100 | 
|---|---|---|
| committer | Richard Oudkerk <shibturn@gmail.com> | 2013-06-10 15:38:54 +0100 | 
| commit | 409f90237c07d2365f6e0b527071e74415c073f3 (patch) | |
| tree | 67c2de474717185c2d2981f0ff9b8ca9823b6e9b /Python/dynload_win.c | |
| parent | a822d366750ea0817276f35fd3adcd894472a70a (diff) | |
| download | cpython-git-409f90237c07d2365f6e0b527071e74415c073f3.tar.gz | |
Issue #18180: Fix ref leak in _PyImport_GetDynLoadWindows().
Diffstat (limited to 'Python/dynload_win.c')
| -rw-r--r-- | Python/dynload_win.c | 5 | 
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;  | 
