summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@blackbox>2011-07-06 22:47:56 +0200
committerGrigori Goronzy <greg@blackbox>2011-07-06 22:47:56 +0200
commit87d472953d5eb58a0e0b8d6414e7ffcd3678d83a (patch)
tree331ba2ac4406955e53021c53a6421796f4d11235
parentcd5a2230524cff693bf678f6430f563b5a6b5afe (diff)
downloadlibass-87d472953d5eb58a0e0b8d6414e7ffcd3678d83a.tar.bz2
libass-87d472953d5eb58a0e0b8d6414e7ffcd3678d83a.tar.xz
Fix cache leak
Fixes a leak introduced with the new cache functions, caused by wrong pointer usage.
-rw-r--r--libass/ass_cache.c2
1 files changed, 1 insertions, 1 deletions
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);