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

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 01 Oct 2001 09:42:51 -0700


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv6736

Modified Files:
	typeobject.c 
Log Message:
slot_sq_length(): squash a leak.

Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.80
retrieving revision 2.81
diff -C2 -d -r2.80 -r2.81
*** typeobject.c	2001/10/01 15:55:28	2.80
--- typeobject.c	2001/10/01 16:42:49	2.81
***************
*** 2730,2737 ****
  	static PyObject *len_str;
  	PyObject *res = call_method(self, "__len__", &len_str, "()");
  
  	if (res == NULL)
  		return -1;
! 	return (int)PyInt_AsLong(res);
  }
  
--- 2730,2740 ----
  	static PyObject *len_str;
  	PyObject *res = call_method(self, "__len__", &len_str, "()");
+ 	int len;
  
  	if (res == NULL)
  		return -1;
! 	len = (int)PyInt_AsLong(res);
! 	Py_DECREF(res);
! 	return len;
  }