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 627e7bc

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 97e92db commit 627e7bc
Copy full SHA for 627e7bc

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
@@ -696,8 +696,10 @@ tuple_subtype_new(PyTypeObject *type, PyObject *iterable)
696696
return NULL;
697697
assert(PyTuple_Check(tmp));
698698
newobj = type->tp_alloc(type, n = PyTuple_GET_SIZE(tmp));
699-
if (newobj == NULL)
699+
if (newobj == NULL) {
700+
Py_DECREF(tmp);
700701
return NULL;
702+
}
701703
for (i = 0; i < n; i++) {
702704
item = PyTuple_GET_ITEM(tmp, i);
703705
Py_INCREF(item);

0 commit comments

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