From: Martin v. Löwis Date: Fri, 15 Feb 2008 19:11:46 +0000 (+0000) Subject: Fix deallocation of array objects when allocation ran out of memory. X-Git-Tag: v2.5.2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9c04257bf91df5739bc071ba07c307a8cce3063b;p=python Fix deallocation of array objects when allocation ran out of memory. --- diff --git a/Misc/NEWS b/Misc/NEWS index bc01a3605a..d5efce7bdb 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -4,6 +4,17 @@ Python News (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 2.5.2? +============================= + +*Release date: XX-Feb-2008* + +Extension Modules +----------------- + +- Fix deallocation of array objects when allocation ran out of memory. + + What's New in Python 2.5.2c1? ============================= diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index da6e88f129..eafea988c9 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -439,6 +439,7 @@ newarrayobject(PyTypeObject *type, Py_ssize_t size, struct arraydescr *descr) else { op->ob_item = PyMem_NEW(char, nbytes); if (op->ob_item == NULL) { + _Py_ForgetReference(op); PyObject_Del(op); return PyErr_NoMemory(); }