[Python-checkins] python/dist/src/Objects intobject.c,2.105,2.106

mwh at users.sourceforge.net mwh at users.sourceforge.net
Mon Aug 11 11:32:04 EDT 2003


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

Modified Files:
	intobject.c 
Log Message:
Add a couple of decrefs to error paths.

Now test_descr only appears to leak two references & I think this
are in fact illusory (it's to do with things getting resurrected in
__del__ methods & it's easy to be believe confusion occurs when that
happens <wink>).  Woohoo! 


Index: intobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v
retrieving revision 2.105
retrieving revision 2.106
diff -C2 -d -r2.105 -r2.106
*** intobject.c	28 Jun 2003 20:04:24 -0000	2.105
--- intobject.c	11 Aug 2003 17:32:02 -0000	2.106
***************
*** 948,957 ****
  			PyErr_SetString(PyExc_ValueError,
  					"value must convertable to an int");
  			return NULL;
  		}
  		ival = PyLong_AsLong(tmp);
! 		if (ival == -1 && PyErr_Occurred())
  			return NULL;
! 
  	} else {
  		ival = ((PyIntObject *)tmp)->ob_ival;
--- 948,959 ----
  			PyErr_SetString(PyExc_ValueError,
  					"value must convertable to an int");
+ 			Py_DECREF(tmp);
  			return NULL;
  		}
  		ival = PyLong_AsLong(tmp);
! 		if (ival == -1 && PyErr_Occurred()) {
! 			Py_DECREF(tmp);
  			return NULL;
! 		}
  	} else {
  		ival = ((PyIntObject *)tmp)->ob_ival;





More information about the Python-checkins mailing list