[Mesa-dev] [PATCH] util/disk_cache: Remove unneeded free() on always null string

Eric Engestrom eric.engestrom at imgtec.com
Thu Dec 7 11:56:25 UTC 2017


On Monday, 2017-12-04 11:47:33 +0200, vadim.shovkoplias at gmail.com wrote:
> From: Vadym Shovkoplias <vadym.shovkoplias at globallogic.com>
> 
> At this point dc_job->cache_item_metadata.keys always equals
> NULL, so call to free() is useless
> 
> Fixes: b86ecea3446 ("util/disk_cache: write cache item metadata to disk")
> Signed-off-by: Vadym Shovkoplias <vadym.shovkoplias at globallogic.com>

R-b and pushed, thanks :)

> 
> ---
>  src/util/disk_cache.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
> index e954065..7ebfa8c 100644
> --- a/src/util/disk_cache.c
> +++ b/src/util/disk_cache.c
> @@ -811,7 +811,6 @@ create_put_job(struct disk_cache *cache, const cache_key key,
>     return dc_job;
>  
>  fail:
> -   free(dc_job->cache_item_metadata.keys);
>     free(dc_job);
>  
>     return NULL;
> -- 
> 2.7.4
> 


More information about the mesa-dev mailing list