From: Andrew M. Kuchling Date: Thu, 5 Oct 2006 19:01:50 +0000 (+0000) Subject: [Backport r51220 | neal.norwitz] X-Git-Tag: v2.4.4c1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=720ea077880294a142e8e0f182b12af0335069e4;p=thirdparty%2FPython%2Fcpython.git [Backport r51220 | neal.norwitz] It's highly unlikely, though possible for PyEval_Get*() to return NULLs. So be safe and do an XINCREF. Klocwork # 221-222. --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index bf61640b30ba..3ae38f3cec95 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -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; }