[Mesa-dev] [PATCH 1/2] disk_cache: fix a memory leak

Marek Olšák maraeo at gmail.com
Fri Oct 6 22:24:31 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Fri, Oct 6, 2017 at 10:21 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
>  src/util/disk_cache.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
> index 17913a913bd..63fd8e1f93a 100644
> --- a/src/util/disk_cache.c
> +++ b/src/util/disk_cache.c
> @@ -1138,20 +1138,21 @@ disk_cache_get(struct disk_cache *cache, const cache_key key, size_t *size)
>                             cf_data.uncompressed_size))
>        goto fail;
>
>     /* Check the data for corruption */
>     if (cf_data.crc32 != util_hash_crc32(uncompressed_data,
>                                          cf_data.uncompressed_size))
>        goto fail;
>
>     free(data);
>     free(filename);
> +   free(file_header);
>     close(fd);
>
>     if (size)
>        *size = cf_data.uncompressed_size;
>
>     return uncompressed_data;
>
>   fail:
>     if (data)
>        free(data);
> --
> 2.11.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list