Skip to content

Commit 4265e31

Browse files
Revert "Update 2026-04-10-16-19-23.gh-issue-148263.trqp3-.rst"
This reverts commit bec9c76.
1 parent 2a4d275 commit 4265e31

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
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.
1+
Fix refcount leak in weakref proxy binary/ternary operations and
2+
proxy_richcompare: when unwrapping the second or third argument fails
3+
(dead proxy), the first argument's refcount was already incremented by
4+
a prior UNWRAP but never released. Introduces UNWRAP_OR(o, cleanup),
5+
which executes cleanup before returning NULL, allowing callers to
6+
release any previously acquired references on failure.

0 commit comments

Comments
 (0)