summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-10-04 12:49:09 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-10-04 12:49:09 -0700
commit03b0198e304a18dcc83febefd58e30ab1f0aac1e (patch)
tree05cbf8d27c7db2ce3cde41bdecdbfda34331c404
parentMerge branch 'eg/mailinfo-doc-scissors' (diff)
parentref-filter: plug memory leak in reach_filter() (diff)
downloadtgif-03b0198e304a18dcc83febefd58e30ab1f0aac1e.tar.xz
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()
-rw-r--r--ref-filter.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ref-filter.c b/ref-filter.c
index 5550a0d34c..e0b8cd3ed8 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -2239,12 +2239,14 @@ static void reach_filter(struct ref_array *array,
{
struct rev_info revs;
int i, old_nr;
- struct commit **to_clear = xcalloc(sizeof(struct commit *), array->nr);
+ struct commit **to_clear;
struct commit_list *cr;
if (!check_reachable)
return;
+ to_clear = xcalloc(sizeof(struct commit *), array->nr);
+
repo_init_revisions(the_repository, &revs, NULL);
for (i = 0; i < array->nr; i++) {