am: release strbufs after use in detect_patch_format()
Don't reset the strbufs l2 and l3 before use as if they were static, but release them at the end instead. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
238e487ea9
commit
542627a4f7
|
|
@ -671,9 +671,7 @@ static int detect_patch_format(const char **paths)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
strbuf_reset(&l2);
|
|
||||||
strbuf_getline(&l2, fp);
|
strbuf_getline(&l2, fp);
|
||||||
strbuf_reset(&l3);
|
|
||||||
strbuf_getline(&l3, fp);
|
strbuf_getline(&l3, fp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -696,6 +694,8 @@ static int detect_patch_format(const char **paths)
|
||||||
done:
|
done:
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
strbuf_release(&l1);
|
strbuf_release(&l1);
|
||||||
|
strbuf_release(&l2);
|
||||||
|
strbuf_release(&l3);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue