Commit af46eb8d authored by Victor Stinner's avatar Victor Stinner Committed by Christian Heimes

_pickle: Fix whichmodule() (#3358)

_PyUnicode_FromId() can return NULL: replace Py_INCREF() with
Py_XINCREF().

Fix coverity report: CID 1417269.
parent 564a2c68
......@@ -1705,7 +1705,7 @@ whichmodule(PyObject *global, PyObject *dotted_path)
/* If no module is found, use __main__. */
module_name = _PyUnicode_FromId(&PyId___main__);
Py_INCREF(module_name);
Py_XINCREF(module_name);
return module_name;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment