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 <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4724>
This commit is contained in:
Tomeu Vizoso 2020-04-27 16:09:02 +02:00
parent 3c98c452f0
commit bc11deb86d

View file

@ -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];