From: Timothy Arceri Date: Tue, 7 Feb 2017 01:10:19 +0000 (+1100) Subject: util/disk_cache: check cache exists before calling munmap() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a3ab09f90f83e09578985fbac39e39121d084b75;p=mesa.git util/disk_cache: check cache exists before calling munmap() Reviewed-by: Nicolai Hähnle --- diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c index 250c3316244..1f4e8960e9e 100644 --- a/src/util/disk_cache.c +++ b/src/util/disk_cache.c @@ -377,7 +377,8 @@ disk_cache_create(const char *gpu_name, const char *timestamp) void disk_cache_destroy(struct disk_cache *cache) { - munmap(cache->index_mmap, cache->index_mmap_size); + if (cache) + munmap(cache->index_mmap, cache->index_mmap_size); ralloc_free(cache); }