summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhaowei Yuan <zhaowei.yuan@samsung.com>2019-11-12 14:24:36 +0800
committerZhaowei Yuan <zhaowei.yuan@samsung.com>2019-11-12 14:37:30 +0800
commit50839c47736cbab7db6a9fb25ea0d983434c56cc (patch)
tree9763f9b232eb8cbc918f5c94bfe44aff4501883a
parent6ba0ad84754f802575cc2eb52a1014fc73a15774 (diff)
downloadmesa-50839c47736cbab7db6a9fb25ea0d983434c56cc.tar.gz
mesa-50839c47736cbab7db6a9fb25ea0d983434c56cc.tar.bz2
mesa-50839c47736cbab7db6a9fb25ea0d983434c56cc.zip
platform_tizen: free driver_name if initialization goes wrong
Mallocated driver_name needs to be freed if following steps for initialization goes wrong, whether hw_accel if set or not Change-Id: I3693744d4e486ffafe3366adf456ec0fcb3ea343 Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
-rwxr-xr-xsrc/egl/drivers/dri2/platform_tizen.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/egl/drivers/dri2/platform_tizen.c b/src/egl/drivers/dri2/platform_tizen.c
index 3ab10b9b9f5..ddc399596f5 100755
--- a/src/egl/drivers/dri2/platform_tizen.c
+++ b/src/egl/drivers/dri2/platform_tizen.c
@@ -1597,13 +1597,13 @@ dri2_initialize_tizen(_EGLDriver *drv, _EGLDisplay *disp)
dri2_dpy->loader_extensions = tizen_dri2_loader_extensions;
if (!dri2_load_driver(disp)) {
err = "DRI2: failed to load driver";
- goto cleanup_device;
+ goto cleanup_driver_name;
}
} else {
dri2_dpy->loader_extensions = tizen_image_loader_extensions;
if (!dri2_load_driver_dri3(disp)) {
err = "DRI3: failed to load driver";
- goto cleanup_device;
+ goto cleanup_driver_name;
}
}
} else {
@@ -1671,8 +1671,7 @@ cleanup_screen:
cleanup_driver:
dlclose(dri2_dpy->driver);
cleanup_driver_name:
- if (hw_accel)
- free(dri2_dpy->driver_name);
+ free(dri2_dpy->driver_name);
cleanup_device:
tpl_object_unreference((tpl_object_t *)tpl_display);
cleanup_display: