It's highly unlikely, though possible for PyEval_Get*() to return NULLs.

So be safe and do an XINCREF.

Klocwork # 221-222.
This commit is contained in:
Neal Norwitz 2006-08-12 01:46:42 +00:00
parent 84167d09cd
commit 43bd4db933
1 changed files with 2 additions and 2 deletions

View 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;
}