Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refleak in reduce_newobj in typeobject.c #116296

Closed
erlend-aasland opened this issue Mar 4, 2024 · 0 comments · Fixed by #116297
Closed

Refleak in reduce_newobj in typeobject.c #116296

erlend-aasland opened this issue Mar 4, 2024 · 0 comments · Fixed by #116297
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@erlend-aasland
Copy link
Contributor

erlend-aasland commented Mar 4, 2024

Originally posted by @brandtbucher in #115874 (comment):

I also think I found an unrelated refleak while chasing this down:

diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index fe3b7b87c8..181d032328 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -6549,6 +6549,7 @@ reduce_newobj(PyObject *obj)
     }
     else {
         /* args == NULL */
+        Py_DECREF(copyreg);
         Py_DECREF(kwargs);
         PyErr_BadInternalCall();
         return NULL;

Linked PRs

@erlend-aasland erlend-aasland added type-bug An unexpected behavior, bug, or error interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Mar 4, 2024
erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this issue Mar 4, 2024
erlend-aasland added a commit that referenced this issue Mar 4, 2024
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 4, 2024
…-116297)

(cherry picked from commit 17c4849)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Mar 4, 2024
…-116297)

(cherry picked from commit 17c4849)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
erlend-aasland added a commit that referenced this issue Mar 4, 2024
…) (#116300)

(cherry picked from commit 17c4849)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
erlend-aasland added a commit that referenced this issue Mar 4, 2024
…) (#116299)

(cherry picked from commit 17c4849)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
…16297)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
…16297)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
…16297)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant