zink: Fix memory leak on error path.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable sampler_view going out of scope leaks the storage it points to.

Fixes: 625457caaf ("zink: handle swapchain acquire failures more directly")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16258>
This commit is contained in:
Vinson Lee 2022-04-29 22:57:02 -07:00 committed by Marge Bot
parent 6214251c03
commit 7f91e8fad9

View file

@ -807,8 +807,10 @@ zink_create_sampler_view(struct pipe_context *pctx, struct pipe_resource *pres,
}
if (zink_is_swapchain(res)) {
if (!zink_kopper_acquire(ctx, res, UINT64_MAX))
if (!zink_kopper_acquire(ctx, res, UINT64_MAX)) {
FREE_CL(sampler_view);
return NULL;
}
}
ivci = create_ivci(screen, res, &templ, state->target);