mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-06-21 06:36:02 +00:00
Add check for NULL after malloc()
This commit is contained in:
parent
e44b331cc3
commit
174a45b4bd
1 changed files with 1 additions and 0 deletions
|
|
@ -204,6 +204,7 @@ match(PyObject *self, PyObject *args) {
|
|||
opts.delimiter_sz = copy_unicode_object(delimiter, opts.delimiter, arraysz(opts.delimiter));
|
||||
size_t num_lines = PyList_GET_SIZE(lines);
|
||||
char **clines = malloc(sizeof(char*) * num_lines);
|
||||
if (!clines) { return PyErr_NoMemory(); }
|
||||
size_t *sizes = malloc(sizeof(size_t) * num_lines);
|
||||
if (!sizes) { return PyErr_NoMemory(); }
|
||||
for (size_t i = 0; i < num_lines; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue