Commit 18c2172b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Better error handling for "flush foo".

parent 00fb6abd
...@@ -932,12 +932,13 @@ parse_config_line(int c, gnc_t gnc, void *closure, int *action_return) ...@@ -932,12 +932,13 @@ parse_config_line(int c, gnc_t gnc, void *closure, int *action_return)
free(if_conf); free(if_conf);
} }
} else if(strcmp(token, "flush") == 0) { } else if(strcmp(token, "flush") == 0) {
char *token2, *ifname; char *token2;
c = skip_whitespace(c, gnc, closure); c = skip_whitespace(c, gnc, closure);
c = getword(c, &token2, gnc, closure); c = getword(c, &token2, gnc, closure);
if(c < -1) if(c < -1)
goto fail; goto fail;
if(strcmp(token2, "interface") == 0) { if(strcmp(token2, "interface") == 0) {
char *ifname;
c = getword(c, &ifname, gnc, closure); c = getword(c, &ifname, gnc, closure);
c = skip_eol(c, gnc, closure); c = skip_eol(c, gnc, closure);
if(c < -1) { if(c < -1) {
...@@ -947,6 +948,9 @@ parse_config_line(int c, gnc_t gnc, void *closure, int *action_return) ...@@ -947,6 +948,9 @@ parse_config_line(int c, gnc_t gnc, void *closure, int *action_return)
flush_interface(ifname); flush_interface(ifname);
free(token2); free(token2);
free(ifname); free(ifname);
} else {
free(token2);
goto fail;
} }
} else { } else {
c = parse_option(c, gnc, closure, token); c = parse_option(c, gnc, closure, token);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment