From: Victor Stinner Date: Wed, 17 Jul 2013 19:53:23 +0000 (+0200) Subject: Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure X-Git-Tag: v3.4.0a1~166 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e54b1c4486527075ffbb85e8c3db923aedb5e54;p=python Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure --- diff --git a/Python/importdl.c b/Python/importdl.c index 0ea954cae0..b60f1c75fb 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -77,6 +77,8 @@ _PyImport_LoadDynamicModule(PyObject *name, PyObject *path, FILE *fp) PyObject *msg = PyUnicode_FromFormat("dynamic module does not define " "init function (PyInit_%s)", shortname); + if (msg == NULL) + goto error; PyErr_SetImportError(msg, name, path); Py_DECREF(msg); goto error;