From: Bobby Powers Date: Wed, 16 May 2012 14:50:31 +0000 (-0400) Subject: diff --no-index: don't leak buffers in queue_diff X-Git-Tag: v1.7.10.3~2^2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=176a33542eddc6e319bfef4ca726813ce0b9af55;p=git.git diff --no-index: don't leak buffers in queue_diff queue_diff uses two strbufs, and at the end of the function strbuf_reset was called. This only reset the length of the buffer - any allocated memory was leaked. Using strbuf_release fixes this. Signed-off-by: Bobby Powers Reviewed-by: René Scharfe Signed-off-by: Junio C Hamano --- diff --git a/diff-no-index.c b/diff-no-index.c index 3080b663b..f0b0010ae 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -123,8 +123,8 @@ static int queue_diff(struct diff_options *o, } string_list_clear(&p1, 0); string_list_clear(&p2, 0); - strbuf_reset(&buffer1); - strbuf_reset(&buffer2); + strbuf_release(&buffer1); + strbuf_release(&buffer2); return ret; } else {