core: fix free undefined pointer when strdup failed in the first loop

This commit is contained in:
xujing
2021-09-08 22:42:22 +09:00
committed by Yu Watanabe
parent 39e1753673
commit 1509274359
+2 -2
View File
@@ -800,7 +800,7 @@ int config_parse_exec(
if (!separate_argv0) {
char *w = NULL;
if (!GREEDY_REALLOC(n, nlen + 2))
if (!GREEDY_REALLOC0(n, nlen + 2))
return log_oom();
w = strdup(path);
@@ -832,7 +832,7 @@ int config_parse_exec(
p += 2;
p += strspn(p, WHITESPACE);
if (!GREEDY_REALLOC(n, nlen + 2))
if (!GREEDY_REALLOC0(n, nlen + 2))
return log_oom();
w = strdup(";");