diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-07-17 19:53:23 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-07-17 19:53:23 (GMT) |
commit | 8e54b1c4486527075ffbb85e8c3db923aedb5e54 (patch) | |
tree | 3438443674466d6d0061ffdb09734de0b93892ce | |
parent | 0fae8f9083c9d362611b71b181dcec9d6af394e2 (diff) | |
download | cpython-8e54b1c4486527075ffbb85e8c3db923aedb5e54.zip cpython-8e54b1c4486527075ffbb85e8c3db923aedb5e54.tar.gz cpython-8e54b1c4486527075ffbb85e8c3db923aedb5e54.tar.bz2 |
Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure
-rw-r--r-- | Python/importdl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c index 0ea954c..b60f1c7 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; |