Skip to content

Commit af08a95

Browse files
authored
fix: potential memory leak in pypy (#3774)
1 parent 42a8e31 commit af08a95

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
@@ -2694,9 +2694,9 @@ get_type_override(const void *this_ptr, const type_info *this_type, const char *
26942694
d.ptr());
26952695
if (result == nullptr)
26962696
throw error_already_set();
2697+
Py_DECREF(result);
26972698
if (d["self"].is_none())
26982699
return function();
2699-
Py_DECREF(result);
27002700
#endif
27012701

27022702
return override;

0 commit comments

Comments
 (0)