summaryrefslogtreecommitdiff
path: root/src/attrcache.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-04-21 11:55:57 -0700
committerRussell Belfer <rb@github.com>2014-04-21 11:55:57 -0700
commit17ef678ca543d8b56035e36039ee319c12d0d249 (patch)
treeea7fa695cc304b9f4ee5f9b6f73a8b5a68c9e10a /src/attrcache.c
parent28750a7d98ce5e23bac5c1d119109ded8e8aab73 (diff)
downloadlibgit2-17ef678ca543d8b56035e36039ee319c12d0d249.tar.gz
Fix some coverity-found issues
Diffstat (limited to 'src/attrcache.c')
-rw-r--r--src/attrcache.c10
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);