Skip to content

Commit

Permalink
line-log.c: fix a memleak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Mar 31, 2015
1 parent b260d26 commit 05bfc7d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions line-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 05bfc7d

Please sign in to comment.