[Python-checkins] python/dist/src/Objects listobject.c, 2.156, 2.156.8.1

mwh at users.sourceforge.net mwh at users.sourceforge.net
Thu Aug 14 11:26:01 EDT 2003


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

Modified Files:
      Tag: release23-maint
	listobject.c 
Log Message:
And backport-2-3-4:
Fix reference leak noted in test_types:
Check for a[:] = a _before_ calling PySequence_Fast on a.


Index: listobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v
retrieving revision 2.156
retrieving revision 2.156.8.1
diff -C2 -d -r2.156 -r2.156.8.1
*** listobject.c	17 Jun 2003 19:27:38 -0000	2.156
--- listobject.c	14 Aug 2003 17:25:59 -0000	2.156.8.1
***************
*** 473,485 ****
  	else {
  		char msg[256];
- 		PyOS_snprintf(msg, sizeof(msg),
- 			      "must assign sequence"
- 			      " (not \"%.200s\") to slice",
- 			      v->ob_type->tp_name);
- 		v_as_SF = PySequence_Fast(v, msg);
- 		if(v_as_SF == NULL)
- 			return -1;
- 		n = PySequence_Fast_GET_SIZE(v_as_SF);
- 
  		if (a == b) {
  			/* Special case "a[i:j] = a" -- copy b first */
--- 473,476 ----
***************
*** 492,495 ****
--- 483,495 ----
  			return ret;
  		}
+ 
+ 		PyOS_snprintf(msg, sizeof(msg),
+ 			      "must assign sequence"
+ 			      " (not \"%.200s\") to slice",
+ 			      v->ob_type->tp_name);
+ 		v_as_SF = PySequence_Fast(v, msg);
+ 		if(v_as_SF == NULL)
+ 			return -1;
+ 		n = PySequence_Fast_GET_SIZE(v_as_SF);
  	}
  	if (ilow < 0)





More information about the Python-checkins mailing list