From: Tomeu Vizoso Date: Mon, 27 Apr 2020 14:09:02 +0000 (+0200) Subject: panfrost: Don't leak temporary descriptors array X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bc11deb86d8bc037d842a04f8782461a5472ecf1;p=mesa.git panfrost: Don't leak temporary descriptors array As found by Coverity: >>> CID 1462596: Resource leaks (RESOURCE_LEAK) >>> Variable "descriptors" going out of scope leaks the storage it points to. Signed-off-by: Tomeu Vizoso Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c index 439a09ca54c..4146c8c6742 100644 --- a/src/gallium/drivers/panfrost/pan_cmdstream.c +++ b/src/gallium/drivers/panfrost/pan_cmdstream.c @@ -1328,6 +1328,8 @@ panfrost_emit_texture_descriptors(struct panfrost_batch *batch, descriptors, sizeof(struct bifrost_texture_descriptor) * ctx->sampler_view_count[stage]); + + free(descriptors); } else { uint64_t trampolines[PIPE_MAX_SHADER_SAMPLER_VIEWS];