FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-139817: Fix refleak in TypeAliasType(qualname=non_string) by encukou · Pull Request #140197 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
10 changes: 5 additions & 5 deletions Objects/typevarobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2123,11 +2123,6 @@ typealias_new_impl(PyTypeObject *type, PyObject *name, PyObject *value,
return NULL;
}

PyObject *module = caller();
if (module == NULL) {
return NULL;
}

if (qualname == NULL || qualname == Py_None) {
// If qualname was not set directly, we use name instead.
qualname = name;
Expand All @@ -2138,6 +2133,11 @@ typealias_new_impl(PyTypeObject *type, PyObject *name, PyObject *value,
}
}

efimov-mikhail Oct 16, 2025 •
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

IMO, it's better to place obtaining of module after qualname related if-block and remove a call of Py_DECREF(module).


PyObject *module = caller();
if (module == NULL) {
return NULL;
}

PyObject *ta = (PyObject *)typealias_alloc(
name, qualname, checked_params, NULL, value, module);
Py_DECREF(module);
Expand Down
Loading

Back | FazBrowse Home | New Git URL