line-log.c: fix a memleak
authorStefan Beller <sbeller@google.com>
Tue, 31 Mar 2015 01:22:07 +0000 (18:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 Mar 2015 04:59:57 +0000 (21:59 -0700)
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>
line-log.c

index b7864ad..e13455f 100644 (file)
@@ -1099,6 +1099,7 @@ static int process_all_files(struct line_log_data **range_out,
                        rg->pair = diff_filepair_dup(queue->queue[i]);
                        memcpy(&rg->diff, pairdiff, sizeof(struct diff_ranges));
                }
+               free(pairdiff);
        }
 
        return changed;