mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Check that malloc() succeeds in makelist.
Submitted by: Roman Divacky (who did a very complete review of both make_index.c and phttpget.c)
This commit is contained in:
parent
22aec2a315
commit
4c3cffeb64
1 changed files with 2 additions and 0 deletions
|
|
@ -116,6 +116,8 @@ makelist(char * str, size_t * n)
|
|||
|
||||
/* Allocate and fill an array */
|
||||
d = malloc(*n * sizeof(DEP));
|
||||
if (d == NULL)
|
||||
err(1, "malloc(DEP)");
|
||||
for (i = 0; i < *n; i++) {
|
||||
d[i].name = strdup2(strsep(&str, " "));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue