builtin/log: fix leaking commit list in git-cherry(1)
We're storing the list of commits that git-cherry(1) is about to print into a temporary list. This list is never getting free'd and thus leaks. Fix this. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
8ff6bd4750
commit
a282dbeba7
@ -2675,16 +2675,16 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
|
||||
commit_list_insert(commit, &list);
|
||||
}
|
||||
|
||||
while (list) {
|
||||
for (struct commit_list *l = list; l; l = l->next) {
|
||||
char sign = '+';
|
||||
|
||||
commit = list->item;
|
||||
commit = l->item;
|
||||
if (has_commit_patch_id(commit, &ids))
|
||||
sign = '-';
|
||||
print_commit(sign, commit, verbose, abbrev, revs.diffopt.file);
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
free_commit_list(list);
|
||||
free_patch_ids(&ids);
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user