summaryrefslogtreecommitdiff
path: root/diff-no-index.c
diff options
context:
space:
mode:
authorBobby Powers <bobbypowers@gmail.com>2012-05-16 14:50:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-05-16 18:18:06 (GMT)
commit176a33542eddc6e319bfef4ca726813ce0b9af55 (patch)
tree1ee4eec4f0a849c6181c5082e2f2dc88c8ba616b /diff-no-index.c
parentf3999e03274df6b98a98a32912f5e171d6eea35f (diff)
downloadgit-176a33542eddc6e319bfef4ca726813ce0b9af55.zip
git-176a33542eddc6e319bfef4ca726813ce0b9af55.tar.gz
git-176a33542eddc6e319bfef4ca726813ce0b9af55.tar.bz2
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>
Diffstat (limited to 'diff-no-index.c')
-rw-r--r--diff-no-index.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/diff-no-index.c b/diff-no-index.c
index 3080b66..f0b0010 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 {