Whether this loop is left via EOF/break or upon finding a
non-continuation line, the storage used for the contination line
handling is left behind.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
static int read_one_header_line(struct strbuf *line, FILE *in)
{
+ struct strbuf continuation = STRBUF_INIT;
+
/* Get the first part of the line. */
if (strbuf_getline(line, in, '\n'))
return 0;
*/
for (;;) {
int peek;
- struct strbuf continuation = STRBUF_INIT;
peek = fgetc(in); ungetc(peek, in);
if (peek != ' ' && peek != '\t')
strbuf_rtrim(&continuation);
strbuf_addbuf(line, &continuation);
}
+ strbuf_release(&continuation);
return 1;
}