Propagate error when PyByteArray_Resize() fails in bytearray_translate()

CID 715334
This commit is contained in:
Christian Heimes 2013-07-21 02:04:35 +02:00
parent 8e0908495a
commit c731bbe665
1 changed files with 4 additions and 1 deletions

View File

@ -1506,7 +1506,10 @@ bytearray_translate(PyByteArrayObject *self, PyObject *args)
}
/* Fix the size of the resulting string */
if (inlen > 0)
PyByteArray_Resize(result, output - output_start);
if (PyByteArray_Resize(result, output - output_start) < 0) {
Py_CLEAR(result);
goto done;
}
done:
if (tableobj != NULL)