commit | 280bb5942526c06211185144a5cdb4c5d05aa2f6 | [log] [tgz] |
---|---|---|
author | Rob Landley <rob@landley.net> | Mon Jul 21 19:55:06 2014 -0500 |
committer | Rob Landley <rob@landley.net> | Mon Jul 21 19:55:06 2014 -0500 |
tree | fbcb3899e2c9bc59f03dda0cf5bcaa2fe24a9cb0 | |
parent | 31db579265fa9e0acea036faa486be26f508e67a [diff] |
Fix memory leak in error path.
diff --git a/lib/dirtree.c b/lib/dirtree.c index 361686a..85b1a3c 100644 --- a/lib/dirtree.c +++ b/lib/dirtree.c
@@ -60,7 +60,9 @@ error: if (notdotdot(name)) { char *path = parent ? dirtree_path(parent, 0) : ""; - perror_msg("%s%s%s",path, parent ? "/" : "", name); + + perror_msg("%s%s%s", path, parent ? "/" : "", name); + if (parent) free(path); } if (parent) parent->symlink = (char *)1; free(dt);