summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2001-05-29 08:05:01 (GMT)
committerThomas Wouters <thomas@python.org>2001-05-29 08:05:01 (GMT)
commit477bd2d1e436ef076a0c4a139fb8ed3e01ba138a (patch)
tree5a37c9a1fee9b304a6a1a7b01174144aef24afce
parentfbed5be9e13144f80a30b90dbd670131fdaba51e (diff)
downloadcpython-477bd2d1e436ef076a0c4a139fb8ed3e01ba138a.zip
cpython-477bd2d1e436ef076a0c4a139fb8ed3e01ba138a.tar.gz
cpython-477bd2d1e436ef076a0c4a139fb8ed3e01ba138a.tar.bz2
_PyTuple_Resize: guard against PyTuple_New() returning NULL, using Tim's
suggestion (modulo style).
-rw-r--r--Objects/tupleobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 461b325..183fd33 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -516,7 +516,7 @@ _PyTuple_Resize(PyObject **pv, int newsize, int last_is_sticky)
(current) reference */
Py_DECREF(v);
*pv = PyTuple_New(newsize);
- return 0;
+ return *pv == NULL ? -1 : 0;
}
/* XXX UNREF/NEWREF interface should be more symmetrical */