Skip to content

Commit 08ecaea

Browse files
Update 2026-04-10-16-19-23.gh-issue-148263.trqp3-.rst
1 parent 33808d9 commit 08ecaea

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
fix refcount leak in weakref proxy unwrapping by introducing a safe
2-
_proxy_unwrap helper
1+
Fix refcount leak in weakref proxy operations:
2+
When a weakref proxy was used in binary, ternary, or rich comparison operations
3+
and the second argument turned out to be a dead proxy, the first argument's
4+
reference count was already incremented by the unwrap step but never released,
5+
causing a memory leak.This patch replaces the old UNWRAP macro with
6+
a proper inline function _proxy_unwrap() that tracks whether each
7+
argument was incref'd, and introduces cleanup paths (goto clean_up)
8+
that correctly decref any already-acquired references before
9+
returning NULL on failure. Also added reference cleanup in unary and compare
10+
operations.

0 commit comments

Comments
 (0)