From a3ab09f90f83e09578985fbac39e39121d084b75 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 7 Feb 2017 12:10:19 +1100 Subject: [PATCH] util/disk_cache: check cache exists before calling munmap() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/util/disk_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- 2.30.2