From bc11deb86d8bc037d842a04f8782461a5472ecf1 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Mon, 27 Apr 2020 16:09:02 +0200 Subject: [PATCH] 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: --- src/gallium/drivers/panfrost/pan_cmdstream.c | 2 ++ 1 file changed, 2 insertions(+) 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]; -- 2.30.2