Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff --no-index: don't leak buffers in queue_diff
author
Bobby Powers
<bobbypowers@gmail.com>
Wed, 16 May 2012 14:50:31 +0000
(10:50 -0400)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 16 May 2012 18:18:06 +0000
(11:18 -0700)
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>
diff-no-index.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
f3999e0
)
diff --git
a/diff-no-index.c
b/diff-no-index.c
index 3080b663bc2a04f6099a25d5fa335768dd117bb0..f0b0010aedd67f9b34f43426c47e837dfe2a522b 100644
(file)
--- 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_re
set
(&buffer1);
- strbuf_re
set
(&buffer2);
+ strbuf_re
lease
(&buffer1);
+ strbuf_re
lease
(&buffer2);
return ret;
} else {