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

Detect failure (e.g. realloc failure) in strListReadFile->strListAppend()

parent 1bbbb07c
No related branches found
No related tags found
No related merge requests found
...@@ -664,7 +664,8 @@ str_list_t strListReadFile(FILE* fp, str_list_t* lp, size_t max_line_len) ...@@ -664,7 +664,8 @@ str_list_t strListReadFile(FILE* fp, str_list_t* lp, size_t max_line_len)
if (fgets(buf, max_line_len + 1, fp) == NULL) if (fgets(buf, max_line_len + 1, fp) == NULL)
break; break;
strListAppend(lp, buf, count++); if (strListAppend(lp, buf, count++) == NULL)
break;
} }
if (!feof(fp)) { if (!feof(fp)) {
strListFreeStrings(list); strListFreeStrings(list);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment