From aa1a79036003c2aeaae24877da66e9b46a059cad Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 30 Mar 2010 15:41:31 +0800 Subject: [PATCH] st/dri: Fix a memory leak in dri1_init_screen. Free the returned configs upon errors. --- src/gallium/state_trackers/dri/drm/dri1.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/state_trackers/dri/drm/dri1.c b/src/gallium/state_trackers/dri/drm/dri1.c index 9b5842ba2bf..cca7cd8f0c3 100644 --- a/src/gallium/state_trackers/dri/drm/dri1.c +++ b/src/gallium/state_trackers/dri/drm/dri1.c @@ -514,6 +514,8 @@ dri1_init_screen(__DRIscreen * sPriv) return configs; fail: + if (configs) + FREE(configs); dri_destroy_screen_helper(screen); FREE(screen); return NULL; -- 2.30.2