diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/third_party/src/libcache.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/third_party/src/libcache.c b/src/lib/third_party/src/libcache.c index 4479ff54d..597684ccc 100644 --- a/src/lib/third_party/src/libcache.c +++ b/src/lib/third_party/src/libcache.c @@ -196,7 +196,11 @@ cache_result cache_add(cache_t cache, void *item, uint32_t item_size) { } if(hash_entry_map_prev) { - hash_entry_map_prev->next = hash_entry_map->next; + if (hash_entry_map) { + hash_entry_map_prev->next = hash_entry_map->next; + } else { + hash_entry_map_prev->next = NULL; + } } else { cache->map[hash] = hash_entry_map->next; } |