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 <bobbypowers@gmail.com> Reviewed-by: René Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Bobby Powers committed
May 16, 2012 at 10:50 UTC
176a33542eddc6e319bfef4ca726813ce0b9af55
1 file changed
+2
-2
diff-no-index.c
+2
-2
@@ -123,8 +123,8 @@ static int queue_diff(struct diff_options *o,
123
}
124
string_list_clear(&p1, 0);
125
string_list_clear(&p2, 0);
126
- strbuf_reset(&buffer1);
127
- strbuf_reset(&buffer2);
126
+ strbuf_release(&buffer1);
127
+ strbuf_release(&buffer2);
128
129
return ret;
130
} else {