From: Chia-I Wu Date: Tue, 30 Mar 2010 07:41:31 +0000 (+0800) Subject: st/dri: Fix a memory leak in dri1_init_screen. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa1a79036003c2aeaae24877da66e9b46a059cad;p=mesa.git st/dri: Fix a memory leak in dri1_init_screen. Free the returned configs upon errors. --- 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;