Fix trivial memory leaks to quieten valgrind.
diff --git a/src/dnsmasq.c b/src/dnsmasq.c
index e903a24..e6dabbf 100644
--- a/src/dnsmasq.c
+++ b/src/dnsmasq.c
@@ -627,6 +627,8 @@
}
#ifdef HAVE_LINUX_NETWORK
+ free(hdr);
+ free(data);
if (option_bool(OPT_DEBUG))
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
#endif
diff --git a/src/option.c b/src/option.c
index e4b4865..ae0ad00 100644
--- a/src/option.c
+++ b/src/option.c
@@ -4361,7 +4361,7 @@
{
char *buff = opt_malloc(MAXDNAME);
int option, conffile_opt = '7', testmode = 0;
- char *arg, *conffile = CONFFILE;
+ char *arg, *conffile = NULL;
opterr = 0;
@@ -4476,7 +4476,14 @@
}
if (conffile)
- one_file(conffile, conffile_opt);
+ {
+ one_file(conffile, conffile_opt);
+ free(conffile);
+ }
+ else
+ {
+ one_file(CONFFILE, conffile_opt);
+ }
/* port might not be known when the address is parsed - fill in here */
if (daemon->servers)