summaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cache.c b/src/cache.c
index 88f643b35..be4b037a3 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -77,6 +77,9 @@ static void clear_cache(git_cache *cache)
{
git_cached_obj *evict = NULL;
+ if (kh_size(cache->map) == 0)
+ return;
+
kh_foreach_value(cache->map, evict, {
git_cached_obj_decref(evict);
});