mirror of
https://github.com/python/cpython.git
synced 2025-10-03 21:55:41 +00:00
[3.6] _pickle: Fix whichmodule() (GH-3358) (#3361)
_PyUnicode_FromId() can return NULL: replace Py_INCREF() with
Py_XINCREF().
Fix coverity report: CID 1417269.
(cherry picked from commit af46eb8
)
This commit is contained in:
parent
ff125e1aa9
commit
c3c3062169
1 changed files with 1 additions and 1 deletions
|
@ -1705,7 +1705,7 @@ whichmodule(PyObject *global, PyObject *dotted_path)
|
||||||
|
|
||||||
/* If no module is found, use __main__. */
|
/* If no module is found, use __main__. */
|
||||||
module_name = _PyUnicode_FromId(&PyId___main__);
|
module_name = _PyUnicode_FromId(&PyId___main__);
|
||||||
Py_INCREF(module_name);
|
Py_XINCREF(module_name);
|
||||||
return module_name;
|
return module_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue