From bee771412c03b03a503172023c82d8b37dca8d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Thu, 12 Jan 2023 10:35:21 +0100 Subject: [PATCH] dri: Free the already allocated optionCache and optionInfo on failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These fields are allocated as they have to be taken into account for initScreen. Signed-off-by: Corentin Noël Reviewed-by: Gert Wollny Part-of: --- src/gallium/frontends/dri/dri_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/frontends/dri/dri_util.c b/src/gallium/frontends/dri/dri_util.c index 61f74b7d9fd..026fa5f8560 100644 --- a/src/gallium/frontends/dri/dri_util.c +++ b/src/gallium/frontends/dri/dri_util.c @@ -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; }