[Python-checkins] python/dist/src/Objects typeobject.c,2.259,2.260
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Jun 25 18:17:41 EDT 2004
Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10121
Modified Files:
typeobject.c
Log Message:
Fix leak found by Eric Huss.
Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.259
retrieving revision 2.260
diff -C2 -d -r2.259 -r2.260
*** typeobject.c 11 Jun 2004 14:41:17 -0000 2.259
--- typeobject.c 25 Jun 2004 22:17:39 -0000 2.260
***************
*** 3955,3959 ****
if (func == NULL)
return -1;
! return PyDict_SetItemString(type->tp_dict, "__new__", func);
}
--- 3955,3964 ----
if (func == NULL)
return -1;
! if(PyDict_SetItemString(type->tp_dict, "__new__", func)) {
! Py_DECREF(func);
! return -1;
! }
! Py_DECREF(func);
! return 0;
}
More information about the Python-checkins
mailing list