From 0dcea5973dd91d6ecbeae2b93441ec67f6ba06aa Mon Sep 17 00:00:00 2001 From: Thomas Wouters Date: Tue, 29 May 2001 07:58:45 +0000 Subject: _PyTuple_Resize: guard against PyTuple_New() returning NULL, using Tim's suggestion (modulo style). --- Objects/tupleobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 94f1859..17ec1a0 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -516,7 +516,7 @@ _PyTuple_Resize(PyObject **pv, int newsize) (current) reference */ Py_DECREF(v); *pv = PyTuple_New(newsize); - return 0; + return *pv == NULL ? -1 : 0; } /* XXX UNREF/NEWREF interface should be more symmetrical */ -- cgit v0.12