diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c index 0e9f30f5c64..f3418ce4cb0 100644 --- a/src/gallium/drivers/lima/lima_resource.c +++ b/src/gallium/drivers/lima/lima_resource.c @@ -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;