From: Grigori Goronzy Date: Wed, 6 Jul 2011 20:47:56 +0000 (+0200) Subject: Fix cache leak X-Git-Tag: 0.10.0~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87d472953d5eb58a0e0b8d6414e7ffcd3678d83a;p=libass Fix cache leak Fixes a leak introduced with the new cache functions, caused by wrong pointer usage. --- diff --git a/libass/ass_cache.c b/libass/ass_cache.c index 8a18e0a..ece9a17 100644 --- a/libass/ass_cache.c +++ b/libass/ass_cache.c @@ -244,7 +244,7 @@ void *ass_cache_put(Cache *cache, void *key, void *value) unsigned bucket = cache->hash_func(key, cache->key_size) % cache->buckets; CacheItem **item = &cache->map[bucket]; while (*item) - *item = (*item)->next; + item = &(*item)->next; (*item) = calloc(1, sizeof(CacheItem)); (*item)->key = malloc(cache->key_size); (*item)->value = malloc(cache->value_size);