1 From 28b879ac47b872af6e8c5e86d76806c69338434d Mon Sep 17 00:00:00 2001
2 From: Chen Wei <weichen302@icloud.com>
3 Date: Tue, 17 Feb 2015 22:07:35 +0000
4 Subject: [PATCH 51/55] Fix trivial memory leaks to quieten valgrind.
8 src/option.c | 11 +++++++++--
9 2 files changed, 11 insertions(+), 2 deletions(-)
11 diff --git a/src/dnsmasq.c b/src/dnsmasq.c
12 index e903a24c8105..e6dabbf556f7 100644
15 @@ -627,6 +627,8 @@ int main (int argc, char **argv)
18 #ifdef HAVE_LINUX_NETWORK
21 if (option_bool(OPT_DEBUG))
22 prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
24 diff --git a/src/option.c b/src/option.c
25 index e4b4865d07a5..ae0ad002d8b8 100644
28 @@ -4361,7 +4361,7 @@ void read_opts(int argc, char **argv, char *compile_opts)
30 char *buff = opt_malloc(MAXDNAME);
31 int option, conffile_opt = '7', testmode = 0;
32 - char *arg, *conffile = CONFFILE;
33 + char *arg, *conffile = NULL;
37 @@ -4476,7 +4476,14 @@ void read_opts(int argc, char **argv, char *compile_opts)
41 - one_file(conffile, conffile_opt);
43 + one_file(conffile, conffile_opt);
48 + one_file(CONFFILE, conffile_opt);
51 /* port might not be known when the address is parsed - fill in here */