Commit 120b161a authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix memory leak.

parent 52a924ce
...@@ -367,7 +367,7 @@ parse_nconf(gnc_t gnc, void *closure) ...@@ -367,7 +367,7 @@ parse_nconf(gnc_t gnc, void *closure)
if(c < -1 || token == NULL) if(c < -1 || token == NULL)
goto error; goto error;
nconf->ifname = strdup(token); nconf->ifname = token;
while(c >= 0 && c != '\n') { while(c >= 0 && c != '\n') {
c = skip_whitespace(c, gnc, closure); c = skip_whitespace(c, gnc, closure);
...@@ -413,6 +413,7 @@ parse_nconf(gnc_t gnc, void *closure) ...@@ -413,6 +413,7 @@ parse_nconf(gnc_t gnc, void *closure)
} else { } else {
goto error; goto error;
} }
free(token);
} }
return nconf; return nconf;
......
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