Commit 4d326807 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Fix random memory leaks.

parent 4aad53cf
...@@ -108,9 +108,14 @@ getip(int c, unsigned char **ip_r, int *af_r, gnc_t gnc, void *closure) ...@@ -108,9 +108,14 @@ getip(int c, unsigned char **ip_r, int *af_r, gnc_t gnc, void *closure)
free(t); free(t);
return -2; return -2;
} }
free(t);
ip = malloc(16); ip = malloc(16);
if(ip == NULL) if(ip == NULL) {
free(t);
return -2; return -2;
}
free(t);
memcpy(ip, addr, 16); memcpy(ip, addr, 16);
*ip_r = ip; *ip_r = ip;
if(af_r) if(af_r)
...@@ -136,6 +141,7 @@ getnet(int c, unsigned char **p_r, unsigned char *plen_r, int *af_r, ...@@ -136,6 +141,7 @@ getnet(int c, unsigned char **p_r, unsigned char *plen_r, int *af_r,
free(t); free(t);
return -2; return -2;
} }
free(t);
ip = malloc(16); ip = malloc(16);
if(ip == NULL) if(ip == NULL)
return -2; return -2;
...@@ -308,6 +314,7 @@ parse_config(gnc_t gnc, void *closure) ...@@ -308,6 +314,7 @@ parse_config(gnc_t gnc, void *closure)
} else { } else {
return -1; return -1;
} }
free(token);
filter = parse_filter(gnc, closure); filter = parse_filter(gnc, closure);
if(filter == &error_filter) if(filter == &error_filter)
......
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