Without this change, attempts to examine revs->pending.objects[i].name
when debugging produce random giberish.  On the other hand, it
introduces a small per-basis-ref memory leak.

Signed-off-by: Jonathan Nieder <jrnie...@gmail.com>
---
For illustration.

 bundle.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/bundle.c b/bundle.c
index 311c554..7aff369 100644
--- a/bundle.c
+++ b/bundle.c
@@ -226,8 +226,7 @@ static void list_prerequisite(int bundle_fd, struct 
object_array *pending,
        write_or_die(bundle_fd, buf.buf, buf.len);
 
        rev->object.flags |= UNINTERESTING;
-       add_object_array(&rev->object, buf.buf, pending);
-       strbuf_release(&buf);
+       add_object_array(&rev->object, strbuf_detach(&buf, NULL), pending);
 }
 
 static int list_prerequisites(int bundle_fd, struct rev_info *revs,
-- 
1.7.1.198.g8d802




-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to