]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-tree.c
ui-blob: Do not accept mimetype from user
[ps-cgit] / ui-tree.c
index 1b310d5304b2ebd8c44594e018bc3eb534a6e8f0..3ff2320744b584464e196a25a66fed9be38ee64f 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -143,6 +143,7 @@ static int ls_item(const unsigned char *sha1, struct strbuf *base,
                        htmlf("<tr><td colspan='3'>Bad object: %s %s</td></tr>",
                              name,
                              sha1_to_hex(sha1));
+                       free(name);
                        return 0;
                }
        }
@@ -286,7 +287,7 @@ void cgit_print_tree(const char *rev, char *path)
        walk_tree_ctx.curr_rev = xstrdup(rev);
 
        if (path == NULL) {
-               ls_tree(commit->tree->object.sha1, NULL, &walk_tree_ctx);
+               ls_tree(commit->tree->object.oid.hash, NULL, &walk_tree_ctx);
                goto cleanup;
        }