Fix deallocation of array objects when allocation ran out of memory.
diff --git a/Misc/NEWS b/Misc/NEWS
index bc01a36..d5efce7 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -4,6 +4,17 @@
(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 da6e88f..eafea98 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -439,6 +439,7 @@
else {
op->ob_item = PyMem_NEW(char, nbytes);
if (op->ob_item == NULL) {
+ _Py_ForgetReference(op);
PyObject_Del(op);
return PyErr_NoMemory();
}