On Thu, 24 May 2012 14:49:35 -0600 Eduardo Silva <[email protected]> wrote:
> > First patch fixes a Clang warning. readdir(NULL) is not valid. > > > > - Lauri > > On this case i would suggest a mk_err() and then a exit(EXIT_FAILURE); Attaching updated patch. - Lauri
>From 08ca60af50046e4ec52c06ba3509ff2db99c9526 Mon Sep 17 00:00:00 2001 From: Lauri Kasanen <[email protected]> Date: Fri, 25 May 2012 13:41:06 +0300 Subject: [PATCH] config: Don't pass NULL to readdir, v2 Exit instead of return. Signed-off-by: Lauri Kasanen <[email protected]> --- src/mk_config.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/src/mk_config.c b/src/mk_config.c index c6dfdaf..f545318 100644 --- a/src/mk_config.c +++ b/src/mk_config.c @@ -546,6 +546,8 @@ void mk_config_read_hosts(char *path) mk_string_build(&buf, &len, "%s/sites/", path); if (!(dir = opendir(buf))) { mk_err("Could not open %s", buf); + mk_mem_free(buf); + exit(EXIT_FAILURE); } mk_mem_free(buf); -- 1.7.2.1
_______________________________________________ Monkey mailing list [email protected] http://lists.monkey-project.com/listinfo/monkey
