Skip to content
Snippets Groups Projects
Commit e65d6faa authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix CID 465170

parent 62f78148
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
......@@ -2444,8 +2444,10 @@ void* new_item(void* lp, size_t size, int index, int* total)
if((item = calloc(size, 1)) == NULL)
return NULL;
if((p = realloc(list, size * ((*total) + 1))) == NULL)
if((p = realloc(list, size * ((*total) + 1))) == NULL) {
free(item);
return NULL;
}
list = p;
for(int i = *total; i > index; --i)
list[i] = list[i - 1];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment