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>
This commit is contained in:
Bobby Powers 2012-05-16 10:50:31 -04:00 коммит произвёл Junio C Hamano
Родитель f3999e0327
Коммит 176a33542e
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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 {