Skip to content

Commit 720ea07

Browse files
committed
[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.
1 parent e67841f commit 720ea07

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎Python/bltinmodule.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ builtin_globals(PyObject *self)
687687
PyObject *d;
688688

689689
d = PyEval_GetGlobals();
690-
Py_INCREF(d);
690+
Py_XINCREF(d);
691691
return d;
692692
}
693693

@@ -1118,7 +1118,7 @@ builtin_locals(PyObject *self)
11181118
PyObject *d;
11191119

11201120
d = PyEval_GetLocals();
1121-
Py_INCREF(d);
1121+
Py_XINCREF(d);
11221122
return d;
11231123
}
11241124

0 commit comments

Comments
 (0)