[Python-checkins] python/dist/src/Objects typeobject.c,2.241,2.242

mwh at users.sourceforge.net mwh at users.sourceforge.net
Thu Aug 7 08:58:12 EDT 2003


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

Modified Files:
	typeobject.c 
Log Message:
Repair refcounting on error return from type_set_bases.

Include a test case that failed for one of my efforts to repair this.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.241
retrieving revision 2.242
diff -C2 -d -r2.241 -r2.242
*** typeobject.c	16 Jul 2003 16:17:57 -0000	2.241
--- typeobject.c	7 Aug 2003 14:58:09 -0000	2.242
***************
*** 304,313 ****
  
    bail:
  	type->tp_bases = old_bases;
  	type->tp_base = old_base;
  	type->tp_mro = old_mro;
- 
- 	Py_DECREF(value);
- 	Py_DECREF(new_base);
  
  	return -1;
--- 304,316 ----
  
    bail:
+ 	Py_DECREF(type->tp_bases);
+ 	Py_DECREF(type->tp_base);
+ 	if (type->tp_mro != old_mro) {
+ 		Py_DECREF(type->tp_mro);
+ 	}
+ 
  	type->tp_bases = old_bases;
  	type->tp_base = old_base;
  	type->tp_mro = old_mro;
  
  	return -1;





More information about the Python-checkins mailing list