dri: Free the already allocated optionCache and optionInfo on failure
These fields are allocated as they have to be taken into account for initScreen. Signed-off-by: Corentin Noël <corentin.noel@collabora.com> Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20663>
This commit is contained in:
@@ -138,6 +138,8 @@ driCreateNewScreen2(int scrn, int fd,
|
||||
|
||||
*driver_configs = mesa->initScreen(screen);
|
||||
if (*driver_configs == NULL) {
|
||||
driDestroyOptionCache(&screen->optionCache);
|
||||
driDestroyOptionInfo(&screen->optionInfo);
|
||||
free(screen);
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user