Skip to content

Commit ef84222

Browse files
szederttaylorr
authored andcommitted
line-log: free the diff queues' arrays when processing merge commits
When processing merge commits, the line-level log first creates an array of diff queues, each comparing the merge commit with one of its parents, to check whether any of the files in the given line ranges were modified. Alas, when freeing these queues it only frees the filepairs in the queues, but not the queues' internal arrays holding pointers to those filepairs. Use the diff_free_queue() helper function introduced in the previous commit to free the diff queues' internal arrays as well. Signed-off-by: SZEDER Gábor <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 04ae000 commit ef84222

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

line-log.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,10 +1089,8 @@ static struct diff_filepair *diff_filepair_dup(struct diff_filepair *pair)
10891089

10901090
static void free_diffqueues(int n, struct diff_queue_struct *dq)
10911091
{
1092-
int i, j;
1093-
for (i = 0; i < n; i++)
1094-
for (j = 0; j < dq[i].nr; j++)
1095-
diff_free_filepair(dq[i].queue[j]);
1092+
for (int i = 0; i < n; i++)
1093+
diff_free_queue(&dq[i]);
10961094
free(dq);
10971095
}
10981096

0 commit comments

Comments
 (0)