From ceb4914f42c74de856d8b6199e85d4b2e643ee05 Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Tue, 3 Oct 2006 12:58:52 +0000 Subject: [PATCH] [Backport rev. 47171 by neal.norwitz] Another problem reported by Coverity. Backport candidate. --- Misc/NEWS | 2 +- Objects/cellobject.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) 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); -- 2.47.3