Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c46074

Browse files
committed
Check return result for error
1 parent 51abbc7 commit 7c46074

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Objects/bufferobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ buffer_concat(PyBufferObject *self, PyObject *other)
356356
return NULL;
357357

358358
ob = PyString_FromStringAndSize(NULL, size + count);
359+
if ( ob == NULL )
360+
return NULL;
359361
p = PyString_AS_STRING(ob);
360362
memcpy(p, ptr1, size);
361363
memcpy(p + size, ptr2, count);

0 commit comments

Comments
 (0)