mirror of https://github.com/python/cpython
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:
parent
84167d09cd
commit
43bd4db933
|
@ -759,7 +759,7 @@ builtin_globals(PyObject *self)
|
||||||
PyObject *d;
|
PyObject *d;
|
||||||
|
|
||||||
d = PyEval_GetGlobals();
|
d = PyEval_GetGlobals();
|
||||||
Py_INCREF(d);
|
Py_XINCREF(d);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1190,7 +1190,7 @@ builtin_locals(PyObject *self)
|
||||||
PyObject *d;
|
PyObject *d;
|
||||||
|
|
||||||
d = PyEval_GetLocals();
|
d = PyEval_GetLocals();
|
||||||
Py_INCREF(d);
|
Py_XINCREF(d);
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue