diff options
| author | Vicent Marti <vicent@github.com> | 2014-04-22 11:04:35 +0200 |
|---|---|---|
| committer | Vicent Marti <vicent@github.com> | 2014-04-22 11:04:35 +0200 |
| commit | dac95e4aa33a21c2180566558726e1a3d5c0399a (patch) | |
| tree | c16c8a49bb7dff250eb009fdae7b1c8b23237130 /src/attrcache.c | |
| parent | 2e609e2931b107e87b06d22fdcd21f337ab73155 (diff) | |
| parent | 17ef678ca543d8b56035e36039ee319c12d0d249 (diff) | |
| download | libgit2-dac95e4aa33a21c2180566558726e1a3d5c0399a.tar.gz | |
Merge pull request #2287 from libgit2/rb/moar-coverity-fixes
Fix some issues from the last Coverity scan
Diffstat (limited to 'src/attrcache.c')
| -rw-r--r-- | src/attrcache.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/attrcache.c b/src/attrcache.c index a750154ce..f1bc70467 100644 --- a/src/attrcache.c +++ b/src/attrcache.c @@ -176,10 +176,9 @@ static int attr_cache_lookup( goto cleanup; entry = attr_cache_lookup_entry(cache, relfile); - if (!entry) { - if ((error = attr_cache_make_entry(&entry, repo, relfile)) < 0) - goto cleanup; - } else if (entry->file[source] != NULL) { + if (!entry) + error = attr_cache_make_entry(&entry, repo, relfile); + else if (entry->file[source] != NULL) { file = entry->file[source]; GIT_REFCOUNT_INC(file); } @@ -254,8 +253,7 @@ bool git_attr_cache__is_cached( khiter_t pos; git_attr_file_entry *entry; - if (!(cache = git_repository_attr_cache(repo)) || - !(files = cache->files)) + if (!cache || !(files = cache->files)) return false; pos = git_strmap_lookup_index(files, filename); |
