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>
This commit is contained in:
parent
d90a7fda35
commit
c2e6b6d0d1
@ -1616,6 +1616,7 @@ static void cmd_data(struct strbuf *sb)
|
|||||||
char *term = xstrdup(command_buf.buf + 5 + 2);
|
char *term = xstrdup(command_buf.buf + 5 + 2);
|
||||||
size_t term_len = command_buf.len - 5 - 2;
|
size_t term_len = command_buf.len - 5 - 2;
|
||||||
|
|
||||||
|
strbuf_detach(&command_buf, NULL);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (strbuf_getline(&command_buf, stdin, '\n') == EOF)
|
if (strbuf_getline(&command_buf, stdin, '\n') == EOF)
|
||||||
die("EOF in data (terminator '%s' not found)", term);
|
die("EOF in data (terminator '%s' not found)", term);
|
||||||
|
Loading…
Reference in New Issue
Block a user