Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Tidy up after a directory chain however it ends
A row whose first entry is itself a directory leaked that entry's name. A level git could not read as a tree returned early instead, which also left the row's log, stats and plain links on the deeper path.
Diffstat (limited to 'source')
-rw-r--r--source/ui-tree.c3
1 file changed, 2 insertions, 1 deletion
diff --git a/source/ui-tree.c b/source/ui-tree.c
index 95ff337..43de1bf 100644
--- a/source/ui-tree.c
+++ b/source/ui-tree.c
@@ -254,7 +254,7 @@ static void print_dir_chain(const struct object_id *oid, char *name, char *rev,
tree = lookup_tree(the_repository, &child.oid);
if (!tree)
- return;
+ break;
free(child.name);
child.name = NULL;
@@ -270,6 +270,7 @@ static void print_dir_chain(const struct object_id *oid, char *name, char *rev,
name = child.name;
}
+ free(child.name);
strbuf_setlen(fullpath, initial_length);
}