[Python-checkins] CVS: python/dist/src/Objects listobject.c,2.81,2.82

Vladimir Marangozov python-dev@python.org
Fri, 14 Jul 2000 20:31:33 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv12089

Modified Files:
	listobject.c 
Log Message:
Fix in PyList_New().  With GC enabled and when out of memory,
free() the GC pointer, not the object pointer.


Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.81
retrieving revision 2.82
diff -C2 -r2.81 -r2.82
*** listobject.c	2000/07/12 13:03:02	2.81
--- listobject.c	2000/07/15 03:31:31	2.82
***************
*** 61,65 ****
  		op->ob_item = (PyObject **) PyMem_MALLOC(nbytes);
  		if (op->ob_item == NULL) {
! 			PyObject_FREE(op);
  			return PyErr_NoMemory();
  		}
--- 61,65 ----
  		op->ob_item = (PyObject **) PyMem_MALLOC(nbytes);
  		if (op->ob_item == NULL) {
! 			PyObject_FREE(PyObject_AS_GC(op));
  			return PyErr_NoMemory();
  		}