X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=notes.c;h=03e7d0cd2ddaf623fd41d4969348c624beee56d5;hb=d3eebaad5ef02284c86d6c4b80199eac58c6729b;hp=75c028b3005a8af8f39e9bceb7ab6e4b3b5dff83;hpb=b9ac6c59b82dead613b31a51c8bca4dbd441bcbe;p=thirdparty%2Fgit.git diff --git a/notes.c b/notes.c index 75c028b300..03e7d0cd2d 100644 --- a/notes.c +++ b/notes.c @@ -269,8 +269,10 @@ static int note_tree_insert(struct notes_tree *t, struct int_node *tree, case PTR_TYPE_NOTE: if (oideq(&l->key_oid, &entry->key_oid)) { /* skip concatenation if l == entry */ - if (oideq(&l->val_oid, &entry->val_oid)) + if (oideq(&l->val_oid, &entry->val_oid)) { + free(entry); return 0; + } ret = combine_notes(&l->val_oid, &entry->val_oid); @@ -458,7 +460,7 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree, die("Failed to load %s %s into notes tree " "from %s", type == PTR_TYPE_NOTE ? "note" : "subtree", - oid_to_hex(&l->key_oid), t->ref); + oid_to_hex(&object_oid), t->ref); continue;