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 c81609e

Browse filesBrowse files
authored
Fix a possible refleak in tupleobject.c (GH-19018)
1 parent 8689209 commit c81609e
Copy full SHA for c81609e

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
@@ -737,8 +737,10 @@ tuple_subtype_new(PyTypeObject *type, PyObject *iterable)
737737
return NULL;
738738
assert(PyTuple_Check(tmp));
739739
newobj = type->tp_alloc(type, n = PyTuple_GET_SIZE(tmp));
740-
if (newobj == NULL)
740+
if (newobj == NULL) {
741+
Py_DECREF(tmp);
741742
return NULL;
743+
}
742744
for (i = 0; i < n; i++) {
743745
item = PyTuple_GET_ITEM(tmp, i);
744746
Py_INCREF(item);

0 commit comments

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