From 165eecf1f64b800321745956064ae0a5007b0ca4 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sat, 25 Jan 2014 15:56:59 +0000 Subject: 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 --- src/egl/drivers/dri2/platform_android.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/egl/drivers') 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: -- cgit v1.2.3