diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-09-05 21:30:16 (GMT) |
---|---|---|
committer | Christian Heimes <christian@python.org> | 2017-09-05 21:30:16 (GMT) |
commit | af46eb8d5f23c6f4e69a6a1f579fac8c2250b7c2 (patch) | |
tree | 2c658c1719de444619c52733f0fac6c311036d9a /Modules/_pickle.c | |
parent | 564a2c68add64ebf2e558a54f5697513b19293cb (diff) | |
download | cpython-af46eb8d5f23c6f4e69a6a1f579fac8c2250b7c2.zip cpython-af46eb8d5f23c6f4e69a6a1f579fac8c2250b7c2.tar.gz cpython-af46eb8d5f23c6f4e69a6a1f579fac8c2250b7c2.tar.bz2 |
_pickle: Fix whichmodule() (#3358)
_PyUnicode_FromId() can return NULL: replace Py_INCREF() with
Py_XINCREF().
Fix coverity report: CID 1417269.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r-- | Modules/_pickle.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index 2a3e739..2525536 100644 --- a/Modules/_pickle.c +++ b/Modules/_pickle.c @@ -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; } |