From: Emil Velikov Date: Sat, 25 Jan 2014 15:56:59 +0000 (+0000) Subject: egl/dri2/android: free driver_name in dri2_initialize_android error path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=165eecf1f64b800321745956064ae0a5007b0ca4;p=mesa.git egl/dri2/android: free driver_name in dri2_initialize_android error path v2: Cleanup driver name if dri2_load_driver() fails. Spotted by Chad Signed-off-by: Emil Velikov --- diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 4a201c8c6ae..cc19a611349 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -682,7 +682,7 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy) if (!dri2_load_driver(dpy)) { err = "DRI2: failed to load driver"; - goto cleanup_device; + goto cleanup_driver_name; } dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER; @@ -722,6 +722,8 @@ cleanup_screen: dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen); cleanup_driver: dlclose(dri2_dpy->driver); +cleanup_driver_name: + free(dri2_dpy->driver_name); cleanup_device: close(dri2_dpy->fd); cleanup_display: