Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit 176a335

Browse files
bpowersgitster
authored andcommitted
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 <[email protected]> Reviewed-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f3999e0 commit 176a335

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

diff-no-index.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ static int queue_diff(struct diff_options *o,
123123
}
124124
string_list_clear(&p1, 0);
125125
string_list_clear(&p2, 0);
126-
strbuf_reset(&buffer1);
127-
strbuf_reset(&buffer2);
126+
strbuf_release(&buffer1);
127+
strbuf_release(&buffer2);
128128

129129
return ret;
130130
} else {

0 commit comments

Comments
 (0)