line-log.c: fix a memleak
The `filepair` is assigned new memory with any iteration via process_diff_filepair, so free it before the current iteration ends. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
b260d265e1
commit
05bfc7dcaa
@ -1099,6 +1099,7 @@ static int process_all_files(struct line_log_data **range_out,
|
|||||||
rg->pair = diff_filepair_dup(queue->queue[i]);
|
rg->pair = diff_filepair_dup(queue->queue[i]);
|
||||||
memcpy(&rg->diff, pairdiff, sizeof(struct diff_ranges));
|
memcpy(&rg->diff, pairdiff, sizeof(struct diff_ranges));
|
||||||
}
|
}
|
||||||
|
free(pairdiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
return changed;
|
return changed;
|
||||||
|
Loading…
Reference in New Issue
Block a user