summaryrefslogtreecommitdiff
path: root/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cache.c b/cache.c
index 18dc8b7..95548e7 100644
--- a/cache.c
+++ b/cache.c
@@ -142,7 +142,7 @@ void do_cache_free(cache_t *cache, void *ptr) {
}
ptr = pre;
#endif
- if (cache->limit > cache->total) {
+ if (cache->limit != 0 && cache->limit < cache->total) {
/* Allow freeing in case the limit was revised downward */
if (cache->destructor) {
cache->destructor(ptr, NULL);