[Mesa-dev] [PATCH] egl/dri2/android: free driver_name in dri2_initialize_android error path

Emil Velikov emil.l.velikov at gmail.com
Wed Jan 29 12:10:13 PST 2014


v2:
Cleanup driver name if dri2_load_driver() fails. Spotted by Chad

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---

Hmm... I swear I had that hunk in mind when writing the patch.
Or maybe I was day dreaming.

Thanks Chad
 
-Emil

 src/egl/drivers/dri2/platform_android.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index 4a201c8..cc19a61 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:
-- 
1.8.5.2



More information about the mesa-dev mailing list