Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0dcea59

Browse files
committed
_PyTuple_Resize: guard against PyTuple_New() returning NULL, using Tim's
suggestion (modulo style).
1 parent 3a2ab1a commit 0dcea59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/tupleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ _PyTuple_Resize(PyObject **pv, int newsize)
516516
(current) reference */
517517
Py_DECREF(v);
518518
*pv = PyTuple_New(newsize);
519-
return 0;
519+
return *pv == NULL ? -1 : 0;
520520
}
521521

522522
/* XXX UNREF/NEWREF interface should be more symmetrical */

0 commit comments

Comments
 (0)