summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2007-10-26 07:59:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-10-26 22:28:09 (GMT)
commitc2e6b6d0d1e97c5bc2db24388e247bef62faf917 (patch)
tree52d05ba65d84bafd530637daa5a477e4c2524213 /fast-import.c
parentd90a7fda355c251b8ffdd79617fb083c18245ec2 (diff)
downloadgit-c2e6b6d0d1e97c5bc2db24388e247bef62faf917.zip
git-c2e6b6d0d1e97c5bc2db24388e247bef62faf917.tar.gz
git-c2e6b6d0d1e97c5bc2db24388e247bef62faf917.tar.bz2
fast-import.c: fix regression due to strbuf conversion
Without this strbuf_detach(), it yields a double free later, the command is in fact stashed, and this is not a memory leak. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fast-import.c b/fast-import.c
index 6f888f6..f93d7d6 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -1616,6 +1616,7 @@ static void cmd_data(struct strbuf *sb)
char *term = xstrdup(command_buf.buf + 5 + 2);
size_t term_len = command_buf.len - 5 - 2;
+ strbuf_detach(&command_buf, NULL);
for (;;) {
if (strbuf_getline(&command_buf, stdin, '\n') == EOF)
die("EOF in data (terminator '%s' not found)", term);