Merge branch 'al/ref-filter-merged-and-no-merged'

Hotfix.

* al/ref-filter-merged-and-no-merged:
  ref-filter: plug memory leak in reach_filter()
maint
Junio C Hamano 2020-10-04 12:49:09 -07:00
commit 03b0198e30
1 changed files with 3 additions and 1 deletions

View File

@ -2239,12 +2239,14 @@ static void reach_filter(struct ref_array *array,
{ {
struct rev_info revs; struct rev_info revs;
int i, old_nr; int i, old_nr;
struct commit **to_clear = xcalloc(sizeof(struct commit *), array->nr); struct commit **to_clear;
struct commit_list *cr; struct commit_list *cr;


if (!check_reachable) if (!check_reachable)
return; return;


to_clear = xcalloc(sizeof(struct commit *), array->nr);

repo_init_revisions(the_repository, &revs, NULL); repo_init_revisions(the_repository, &revs, NULL);


for (i = 0; i < array->nr; i++) { for (i = 0; i < array->nr; i++) {