From 9c04257bf91df5739bc071ba07c307a8cce3063b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Fri, 15 Feb 2008 19:11:46 +0000 Subject: [PATCH] Fix deallocation of array objects when allocation ran out of memory. --- Misc/NEWS | 11 +++++++++++ Modules/arraymodule.c | 1 + 2 files changed, 12 insertions(+) diff --git a/Misc/NEWS b/Misc/NEWS index bc01a3605ab8..d5efce7bdbd0 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 da6e88f12959..eafea988c967 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(); } -- 2.47.3