X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=fast-import.c;h=a85275dc682d2bb8068f003b8281c3933488f010;hb=ee459baa5ce0a144e013a4995fd5be96bbecd05e;hp=6cd19e580ba710d03682fcaff997fa7e0e555691;hpb=66b8800e53b20cda13446b462531641884089a77;p=git.git diff --git a/fast-import.c b/fast-import.c index 6cd19e580..a85275dc6 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1641,6 +1641,8 @@ static int tree_content_get( n = slash1 - p; else n = strlen(p); + if (!n) + die("Empty path component found in input"); if (!root->tree) load_tree(root); @@ -2712,7 +2714,7 @@ static void parse_new_tag(void) /* Obtain the new tag name from the rest of our command */ sp = strchr(command_buf.buf, ' ') + 1; t = pool_alloc(sizeof(struct tag)); - t->next_tag = NULL; + memset(t, 0, sizeof(struct tag)); t->name = pool_strdup(sp); if (last_tag) last_tag->next_tag = t; @@ -3028,6 +3030,8 @@ static void parse_ls(struct branch *b) store_tree(&leaf); print_ls(leaf.versions[1].mode, leaf.versions[1].sha1, p); + if (leaf.tree) + release_tree_content_recursive(leaf.tree); if (!b || root != &b->branch_tree) release_tree_entry(root); }