]> granicus.if.org Git - python/commitdiff
Fix deallocation of array objects when allocation ran out of memory.
authorMartin v. Löwis <martin@v.loewis.de>
Fri, 15 Feb 2008 19:11:46 +0000 (19:11 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Fri, 15 Feb 2008 19:11:46 +0000 (19:11 +0000)
Misc/NEWS
Modules/arraymodule.c

index bc01a3605ab8df4febf90e3cf598d2cd8fecd3a9..d5efce7bdbd017d845d0ac7fd355e9a30c238684 100644 (file)
--- 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?
 =============================
 
index da6e88f1295973c2f1992ba5511a54343b4adb3e..eafea988c9674b8c7f3fa9eb2ee17ce359d040e1 100644 (file)
@@ -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();
                }