summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2013-02-04 21:40:07 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2013-02-04 21:40:07 +0000
commit39595cfe31abb61951ae40c294df441794a9e438 (patch)
tree01e82d0bb4650301b88d7fcb54a1dcb7282b806c
parentffa3d7d6a201d01fc6551837e9e1b5643919bf5d (diff)
downloaddnsmasq-39595cfe31abb61951ae40c294df441794a9e438.tar.gz
Fix memory leak.
-rw-r--r--src/option.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/option.c b/src/option.c
index c9e7382..18be327 100644
--- a/src/option.c
+++ b/src/option.c
@@ -1369,14 +1369,14 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
strcat(path, "/");
strcat(path, ent->d_name);
+ /* files must be readable */
if (stat(path, &buf) == -1)
die(_("cannot access %s: %s"), path, EC_FILE);
+
/* only reg files allowed. */
- if (!S_ISREG(buf.st_mode))
- continue;
+ if (S_ISREG(buf.st_mode))
+ one_file(path, 0);
- /* files must be readable */
- one_file(path, 0);
free(path);
}