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);