提交 176a3354 编写于 作者: B Bobby Powers 提交者: Junio C Hamano

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: NBobby Powers <bobbypowers@gmail.com>
Reviewed-by: NRené Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 f3999e03
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册