memory allocation failure
Replace also PyMem_Free() with PyMem_FREE() to be consistent with the rest of
the function.
that is not included in acc.
*/
remain = (int *)PyMem_MALLOC(SIZEOF_INT*to_merge_size);
- if (remain == NULL)
+ if (remain == NULL) {
+ PyErr_NoMemory();
return -1;
+ }
for (i = 0; i < to_merge_size; i++)
remain[i] = 0;
}
ok = PyList_Append(acc, candidate);
if (ok < 0) {
- PyMem_Free(remain);
+ PyMem_FREE(remain);
return -1;
}
for (j = 0; j < to_merge_size; j++) {