Skip to content

Commit ce08e37

Browse files
authored
fix: handle NULL correctly (#5145)
1 parent 86a6429 commit ce08e37

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/pybind11/pybind11.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ get_type_override(const void *this_ptr, const type_info *this_type, const char *
27802780
PyObject *locals = PyEval_GetFrameLocals();
27812781
# else
27822782
PyObject *locals = PyEval_GetLocals();
2783-
Py_INCREF(locals);
2783+
Py_XINCREF(locals);
27842784
# endif
27852785
if (locals != nullptr) {
27862786
# if PY_VERSION_HEX >= 0x030b0000

0 commit comments

Comments
 (0)