Check return result for error

This commit is contained in:
Neal Norwitz 2005-12-18 08:02:38 +00:00
parent 51abbc7b4a
commit 7c460740ed
1 changed files with 2 additions and 0 deletions

View File

@ -356,6 +356,8 @@ buffer_concat(PyBufferObject *self, PyObject *other)
return NULL;
ob = PyString_FromStringAndSize(NULL, size + count);
if ( ob == NULL )
return NULL;
p = PyString_AS_STRING(ob);
memcpy(p, ptr1, size);
memcpy(p + size, ptr2, count);