Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 890dcfe

Browse filesBrowse files
Fix a possible refleak in tupleobject.c (GH-19018)
(cherry picked from commit c81609e) Co-authored-by: Hai Shi <shihai1992@gmail.com>
1 parent f7e32fc commit 890dcfe
Copy full SHA for 890dcfe

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎Objects/tupleobject.c

Copy file name to clipboardExpand all lines: Objects/tupleobject.c
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,8 +719,10 @@ tuple_subtype_new(PyTypeObject *type, PyObject *iterable)
719719
return NULL;
720720
assert(PyTuple_Check(tmp));
721721
newobj = type->tp_alloc(type, n = PyTuple_GET_SIZE(tmp));
722-
if (newobj == NULL)
722+
if (newobj == NULL) {
723+
Py_DECREF(tmp);
723724
return NULL;
725+
}
724726
for (i = 0; i < n; i++) {
725727
item = PyTuple_GET_ITEM(tmp, i);
726728
Py_INCREF(item);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.