summaryrefslogtreecommitdiff
path: root/Python/importdl.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-17 21:53:23 +0200
committerVictor Stinner <victor.stinner@gmail.com>2013-07-17 21:53:23 +0200
commit8e54b1c4486527075ffbb85e8c3db923aedb5e54 (patch)
tree3438443674466d6d0061ffdb09734de0b93892ce /Python/importdl.c
parent0fae8f9083c9d362611b71b181dcec9d6af394e2 (diff)
downloadcpython-git-8e54b1c4486527075ffbb85e8c3db923aedb5e54.tar.gz
Issue #18408: Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure
Diffstat (limited to 'Python/importdl.c')
-rw-r--r--Python/importdl.c2
1 files changed, 2 insertions, 0 deletions
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;