diff options
author | Georg Brandl <georg@python.org> | 2009-07-22 12:03:09 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-07-22 12:03:09 (GMT) |
commit | 11a81b21518a263aea9642f29cbd9e78326982a6 (patch) | |
tree | f3b20581f6e4691fc4b24d4e23a49befc8e79cee /Objects | |
parent | 087d1a6d4b8659a9270eaec1154c151c0149f69c (diff) | |
download | cpython-11a81b21518a263aea9642f29cbd9e78326982a6.zip cpython-11a81b21518a263aea9642f29cbd9e78326982a6.tar.gz cpython-11a81b21518a263aea9642f29cbd9e78326982a6.tar.bz2 |
Merged revisions 74167 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r74167 | georg.brandl | 2009-07-22 13:57:15 +0200 (Mi, 22 Jul 2009) | 1 line
Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.
........
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/bytearrayobject.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/bytearrayobject.c b/Objects/bytearrayobject.c index b5dd81b..7eafce7 100644 --- a/Objects/bytearrayobject.c +++ b/Objects/bytearrayobject.c @@ -1458,15 +1458,14 @@ bytes_translate(PyByteArrayObject *self, PyObject *args) if (vtable.len != 256) { PyErr_SetString(PyExc_ValueError, "translation table must be 256 characters long"); - result = NULL; - goto done; + PyBuffer_Release(&vtable); + return NULL; } if (delobj != NULL) { if (_getbuffer(delobj, &vdel) < 0) { - result = NULL; - delobj = NULL; /* don't try to release vdel buffer on exit */ - goto done; + PyBuffer_Release(&vtable); + return NULL; } } else { |