diff options
| author | Carlos Martín Nieto <cmn@elego.de> | 2011-05-31 15:11:49 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@elego.de> | 2011-05-31 17:33:24 +0200 |
| commit | 7288d8b65c5f584f14eff045ab2f70a97a666898 (patch) | |
| tree | 88cbd0ad681d1e5f929f55f3969cc94b99b4cd05 | |
| parent | 7bc9e2aa2fe4b554021129fabb8a46b5a33ed4e9 (diff) | |
| download | libgit2-7288d8b65c5f584f14eff045ab2f70a97a666898.tar.gz | |
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>
| -rw-r--r-- | src/config_file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/config_file.c b/src/config_file.c index 37e3f1f15..4b7ce069e 100644 --- a/src/config_file.c +++ b/src/config_file.c @@ -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++]; |
