diff options
author | Russell Belfer <rb@github.com> | 2014-04-21 11:55:57 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-04-21 11:55:57 -0700 |
commit | 17ef678ca543d8b56035e36039ee319c12d0d249 (patch) | |
tree | ea7fa695cc304b9f4ee5f9b6f73a8b5a68c9e10a /src/ignore.c | |
parent | 28750a7d98ce5e23bac5c1d119109ded8e8aab73 (diff) | |
download | libgit2-17ef678ca543d8b56035e36039ee319c12d0d249.tar.gz |
Fix some coverity-found issues
Diffstat (limited to 'src/ignore.c')
-rw-r--r-- | src/ignore.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ignore.c b/src/ignore.c index b08ff2200..f373c9482 100644 --- a/src/ignore.c +++ b/src/ignore.c @@ -32,9 +32,9 @@ static int parse_ignore_file( } while (!error && *scan) { - if (!match) { - match = git__calloc(1, sizeof(*match)); - GITERR_CHECK_ALLOC(match); + if (!match && !(match = git__calloc(1, sizeof(*match)))) { + error = -1; + break; } match->flags = GIT_ATTR_FNMATCH_ALLOWSPACE | GIT_ATTR_FNMATCH_ALLOWNEG; |