Fix memory leak.

This commit is contained in:
Simon Kelley
2013-02-04 21:40:07 +00:00
parent ffa3d7d6a2
commit 39595cfe31

View File

@@ -1369,14 +1369,14 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
strcat(path, "/"); strcat(path, "/");
strcat(path, ent->d_name); strcat(path, ent->d_name);
/* files must be readable */
if (stat(path, &buf) == -1) if (stat(path, &buf) == -1)
die(_("cannot access %s: %s"), path, EC_FILE); die(_("cannot access %s: %s"), path, EC_FILE);
/* only reg files allowed. */
if (!S_ISREG(buf.st_mode))
continue;
/* files must be readable */ /* only reg files allowed. */
if (S_ISREG(buf.st_mode))
one_file(path, 0); one_file(path, 0);
free(path); free(path);
} }