Skip to content

Commit c2e6b6d

Browse files
MadCodergitster
authored andcommitted
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>
1 parent d90a7fd commit c2e6b6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fast-import.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,6 +1616,7 @@ static void cmd_data(struct strbuf *sb)
16161616
char *term = xstrdup(command_buf.buf + 5 + 2);
16171617
size_t term_len = command_buf.len - 5 - 2;
16181618

1619+
strbuf_detach(&command_buf, NULL);
16191620
for (;;) {
16201621
if (strbuf_getline(&command_buf, stdin, '\n') == EOF)
16211622
die("EOF in data (terminator '%s' not found)", term);

0 commit comments

Comments
 (0)