gallium: Use the common destroy function on screen initialization failure

Avoid leaking configuration options on initialization failure.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23054>
This commit is contained in:
Corentin Noël
2023-05-24 16:41:57 +02:00
committed by Marge Bot
parent 4d25ae350f
commit ad0bcd75fd
+1 -3
View File
@@ -138,9 +138,7 @@ driCreateNewScreen2(int scrn, int fd,
*driver_configs = mesa->initScreen(screen);
if (*driver_configs == NULL) {
driDestroyOptionCache(&screen->optionCache);
driDestroyOptionInfo(&screen->optionInfo);
free(screen);
dri_destroy_screen(screen);
return NULL;
}