Commit 61c9f6dccc2e7adc4f58e71e02f61472b0cea060

Stefan Sperling 2018-07-23T13:37:08

plug a leak in got_object_idcache_add()

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/lib/object_idcache.c b/lib/object_idcache.c
index 3e8e8bd..dba2c69 100644
--- a/lib/object_idcache.c
+++ b/lib/object_idcache.c
@@ -87,6 +87,7 @@ got_object_idcache_add(struct got_object_idcache *cache,
 	if (cache->nelem >= cache->maxelem) {
 		entry = TAILQ_LAST(&cache->entries, got_object_idcache_head);
 		TAILQ_REMOVE(&cache->entries, entry, entry);
+		free(entry);
 		cache->nelem--;
 	}