]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
It's highly unlikely, though possible for PyEval_Get*() to return NULLs.
authorNeal Norwitz <nnorwitz@gmail.com>
Sat, 12 Aug 2006 01:46:42 +0000 (01:46 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Sat, 12 Aug 2006 01:46:42 +0000 (01:46 +0000)
So be safe and do an XINCREF.

Klocwork # 221-222.

Python/bltinmodule.c

index 58dc7c956b92ef6f419b7d70c98c3b5ec4edd7b2..5bae619774e70f184cfec85424647ab951050894 100644 (file)
@@ -759,7 +759,7 @@ builtin_globals(PyObject *self)
        PyObject *d;
 
        d = PyEval_GetGlobals();
-       Py_INCREF(d);
+       Py_XINCREF(d);
        return d;
 }
 
@@ -1190,7 +1190,7 @@ builtin_locals(PyObject *self)
        PyObject *d;
 
        d = PyEval_GetLocals();
-       Py_INCREF(d);
+       Py_XINCREF(d);
        return d;
 }