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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user