Commit 28b879ac authored by Chen Wei's avatar Chen Wei Committed by Simon Kelley

Fix trivial memory leaks to quieten valgrind.

parent caeea190
...@@ -627,6 +627,8 @@ int main (int argc, char **argv) ...@@ -627,6 +627,8 @@ int main (int argc, char **argv)
} }
#ifdef HAVE_LINUX_NETWORK #ifdef HAVE_LINUX_NETWORK
free(hdr);
free(data);
if (option_bool(OPT_DEBUG)) if (option_bool(OPT_DEBUG))
prctl(PR_SET_DUMPABLE, 1, 0, 0, 0); prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
#endif #endif
......
...@@ -4361,7 +4361,7 @@ void read_opts(int argc, char **argv, char *compile_opts) ...@@ -4361,7 +4361,7 @@ void read_opts(int argc, char **argv, char *compile_opts)
{ {
char *buff = opt_malloc(MAXDNAME); char *buff = opt_malloc(MAXDNAME);
int option, conffile_opt = '7', testmode = 0; int option, conffile_opt = '7', testmode = 0;
char *arg, *conffile = CONFFILE; char *arg, *conffile = NULL;
opterr = 0; opterr = 0;
...@@ -4476,7 +4476,14 @@ void read_opts(int argc, char **argv, char *compile_opts) ...@@ -4476,7 +4476,14 @@ void read_opts(int argc, char **argv, char *compile_opts)
} }
if (conffile) 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 */ /* port might not be known when the address is parsed - fill in here */
if (daemon->servers) if (daemon->servers)
......
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