summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cache.c b/src/cache.c
index 9e566792a..f445e906d 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -32,11 +32,10 @@ int git_cache_init(git_cache *cache, size_t size, git_cached_obj_freeptr free_pt
git_mutex_init(&cache->lock);
cache->nodes = git__malloc(size * sizeof(git_cached_obj *));
- if (cache->nodes == NULL)
- return GIT_ENOMEM;
+ GITERR_CHECK_ALLOC(cache->nodes);
memset(cache->nodes, 0x0, size * sizeof(git_cached_obj *));
- return GIT_SUCCESS;
+ return 0;
}
void git_cache_free(git_cache *cache)