summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-05-24 15:54:00 +0200
committerGitHub <noreply@github.com>2019-05-24 15:54:00 +0200
commitac070afecc33e9f263353455debd07876b0e91bf (patch)
treee43d28cb88740b0d95c2ae0bbd8728708bc09d98 /src
parentbcb4d1d00c7306a4f368f6a1a3c63c2ae738aae9 (diff)
parentadd1743580149c3d1e570aafff3180cee216162e (diff)
downloadlibgit2-ac070afecc33e9f263353455debd07876b0e91bf.tar.gz
Merge pull request #5088 from pks-t/pks/cache-eviction-segfault
cache: fix cache eviction using deallocated key
Diffstat (limited to 'src')
-rw-r--r--src/cache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cache.c b/src/cache.c
index 2f5c8f99b..3128e40c5 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -134,9 +134,8 @@ static void cache_evict_entries(git_cache *cache)
evict_count--;
evicted_memory += evict->size;
- git_cached_obj_decref(evict);
-
git_oidmap_delete(cache->map, key);
+ git_cached_obj_decref(evict);
}
cache->used_memory -= evicted_memory;