]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[Backport r51220 | neal.norwitz]
authorAndrew M. Kuchling <amk@amk.ca>
Thu, 5 Oct 2006 19:01:50 +0000 (19:01 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Thu, 5 Oct 2006 19:01:50 +0000 (19:01 +0000)
It's highly unlikely, though possible for PyEval_Get*() to return NULLs.
So be safe and do an XINCREF.

Klocwork # 221-222.

Python/bltinmodule.c

index bf61640b30ba3ec5e62961f4126320be70c097b2..3ae38f3cec957b606c7b5fb0f606ecfb5947a788 100644 (file)
@@ -687,7 +687,7 @@ builtin_globals(PyObject *self)
        PyObject *d;
 
        d = PyEval_GetGlobals();
-       Py_INCREF(d);
+       Py_XINCREF(d);
        return d;
 }
 
@@ -1118,7 +1118,7 @@ builtin_locals(PyObject *self)
        PyObject *d;
 
        d = PyEval_GetLocals();
-       Py_INCREF(d);
+       Py_XINCREF(d);
        return d;
 }