diff Modules/arraymodule.c @ 45361:4504dfcc1924 2.5

Fix deallocation of array objects when allocation ran out of memory.
author Martin v. Löwis <martin@v.loewis.de>
date Fri, 15 Feb 2008 19:11:46 +0000
parents 8cbe0bd93c28
children 2da42dcbb8ce
line wrap: on
line diff
--- a/Modules/arraymodule.c	Thu Feb 14 14:25:24 2008 +0000
+++ b/Modules/arraymodule.c	Fri Feb 15 19:11:46 2008 +0000
@@ -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();
 		}