From: Andrew M. Kuchling Date: Tue, 3 Oct 2006 12:58:52 +0000 (+0000) Subject: [Backport rev. 47171 by neal.norwitz] X-Git-Tag: v2.4.4c1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceb4914f42c74de856d8b6199e85d4b2e643ee05;p=thirdparty%2FPython%2Fcpython.git [Backport rev. 47171 by neal.norwitz] Another problem reported by Coverity. Backport candidate. --- diff --git a/Misc/NEWS b/Misc/NEWS index e094dcbf2b0b..3b8e66d571a5 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -25,7 +25,7 @@ Core and builtins - Overflow checking code in integer division ran afoul of new gcc optimizations. Changed to be more standard-conforming. -- Fix warnings reported by Klocwork's static analysis tool. +- Fix warnings reported by the Coverity and Klocwork static analysis tools. - Patch #1541585: fix buffer overrun when performing repr() on a unicode string in a build with wide unicode (UCS-4) support. diff --git a/Objects/cellobject.c b/Objects/cellobject.c index 3b870934dc10..6b31b982edf5 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -8,6 +8,8 @@ PyCell_New(PyObject *obj) PyCellObject *op; op = (PyCellObject *)PyObject_GC_New(PyCellObject, &PyCell_Type); + if (op == NULL) + return NULL; op->ob_ref = obj; Py_XINCREF(obj);