summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-08-30 02:58:59 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-08-30 02:58:59 (GMT)
commitcd97da3b1d61be00bb06f3264a60418dbdb83bd8 (patch)
treeee915c66c474c9ab112aeed79de79370524d656f /Objects
parent47e52ee0c5c8868db903d476b49c3368fce4d79a (diff)
downloadcpython-cd97da3b1d61be00bb06f3264a60418dbdb83bd8.zip
cpython-cd97da3b1d61be00bb06f3264a60418dbdb83bd8.tar.gz
cpython-cd97da3b1d61be00bb06f3264a60418dbdb83bd8.tar.bz2
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.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/longobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index 05c42ad..0103e5c 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -2343,7 +2343,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
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 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
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 @@ long_pow(PyObject *v, PyObject *w, PyObject *x)
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;