summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/bytearrayobject.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c
index 165fd10..f3d5697 100644
--- a/Objects/bytearrayobject.c
+++ b/Objects/bytearrayobject.c
@@ -1389,15 +1389,17 @@ bytearray_translate(PyByteArrayObject *self, PyObject *args)
if (vtable.len != 256) {
PyErr_SetString(PyExc_ValueError,
"translation table must be 256 characters long");
- goto done;
+ PyBuffer_Release(&vtable);
+ return NULL;
}
table = (const char*)vtable.buf;
}
if (delobj != NULL) {
if (_getbuffer(delobj, &vdel) < 0) {
- delobj = NULL; /* don't try to release vdel buffer on exit */
- goto done;
+ if (tableobj != NULL)
+ PyBuffer_Release(&vtable);
+ return NULL;
}
}
else {