From 11bc95934f7a4418d2b85cdeeb44d902f65e78ec Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 22 Jul 2024 14:47:04 -0700 Subject: [PATCH] tgsi_to_nir: free disk cache value if the size is wrong Fixes: 4db880d8057 ("ttn: Implement disk cache") Reviewed-by: Ian Romanick Reviewed-by: Rob Clark Part-of: --- src/gallium/auxiliary/nir/tgsi_to_nir.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c index a9acd6f0186..44b81b8ae28 100644 --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c @@ -2600,6 +2600,7 @@ load_nir_from_disk_cache(struct disk_cache *cache, * However we do still check if the first element is indeed the size, * as we cannot fully trust disk_cache_get (EGL_ANDROID_blob_cache) */ if (buffer[0] != size) { + free(buffer); return NULL; }