[Python-checkins] python/dist/src/Objects longobject.c,1.163,1.164

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Mon Aug 30 04:59:02 CEST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29184/Objects

Modified Files:
	longobject.c 
Log Message:
long_pow():  Fix more instances of leaks in error cases.

Bugfix candidate -- although long_pow() is so different now I doubt a
patch would apply to 2.3.


Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -d -r1.163 -r1.164
--- longobject.c	30 Aug 2004 02:44:38 -0000	1.163
+++ longobject.c	30 Aug 2004 02:58:59 -0000	1.164
@@ -2343,7 +2343,7 @@
 		if (c) {
 			PyErr_SetString(PyExc_TypeError, "pow() 2nd argument "
 			    "cannot be negative when 3rd argument specified");
-			return NULL;
+			goto Error;
 		}
 		else {
 			/* else return a float.  This works because we know
@@ -2361,7 +2361,7 @@
 		if (c->ob_size == 0) {
 			PyErr_SetString(PyExc_ValueError,
 					"pow() 3rd argument cannot be 0");
-			goto Done;
+			goto Error;
 		}
 
 		/* if modulus < 0:
@@ -2390,7 +2390,7 @@
 		   Having the base positive just makes things easier. */
 		if (a->ob_size < 0) {
 			if (l_divmod(a, c, NULL, &temp) < 0)
-				goto Done;
+				goto Error;
 			Py_DECREF(a);
 			a = temp;
 			temp = NULL;



More information about the Python-checkins mailing list