Issue #15766: Fix a crash in imp.load_dynamic() on PyUnicode_FromString() failure

This commit is contained in:
Victor Stinner 2012-08-22 17:45:52 +02:00
parent 9bd9cd3fb9
commit ad54c6d82e
1 changed files with 3 additions and 3 deletions

View File

@ -139,9 +139,9 @@ dl_funcptr _PyImport_GetDynLoadFunc(const char *shortname,
path = PyUnicode_FromString(pathname);
mod_name = PyUnicode_FromString(shortname);
PyErr_SetImportError(error_ob, mod_name, path);
Py_DECREF(error_ob);
Py_DECREF(path);
Py_DECREF(mod_name);
Py_XDECREF(error_ob);
Py_XDECREF(path);
Py_XDECREF(mod_name);
return NULL;
}
if (fp != NULL && nhandles < 128)