Commit 7288d8b6 by Carlos Martín Nieto

Parse section header ext: don't leak on error

Also free the subsection if we find too many quotes

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
parent 7bc9e2aa
......@@ -597,8 +597,10 @@ static int parse_section_header_ext(const char *line, const char *base_name, cha
do {
switch (c) {
case '"':
if (quote_marks++ >= 2)
return git__throw(GIT_EOBJCORRUPTED, "Failed to parse ext header. Too many quotes");
if (quote_marks++ >= 2) {
error = git__throw(GIT_EOBJCORRUPTED, "Failed to parse ext header. Too many quotes");
goto out;
}
break;
case '\\':
c = line[rpos++];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment