lima: avoid memleak on error

We should free this pointer, otherwise we're leaking it.

CID: 1521251
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32381>
This commit is contained in:
Erik Faye-Lund 2024-11-27 17:08:02 +01:00 committed by Marge Bot
parent b8bb9e08bc
commit 0d51248e5d

View file

@ -72,8 +72,10 @@ lima_resource_create_scanout(struct pipe_screen *pscreen,
scanout = renderonly_scanout_for_resource(&scanout_templat,
screen->ro, &handle);
if (!scanout)
if (!scanout) {
FREE(res);
return NULL;
}
res->base = *templat;
res->base.screen = pscreen;