Skip to content

Commit 45219c6

Browse files
Skylion007henryiii
authored andcommitted
fix: potential memory leak in pypy (#3774)
1 parent 6f01c60 commit 45219c6

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
@@ -2729,9 +2729,9 @@ get_type_override(const void *this_ptr, const type_info *this_type, const char *
27292729
d.ptr());
27302730
if (result == nullptr)
27312731
throw error_already_set();
2732+
Py_DECREF(result);
27322733
if (d["self"].is_none())
27332734
return function();
2734-
Py_DECREF(result);
27352735
#endif
27362736

27372737
return override;

0 commit comments

Comments
 (0)