diff options
author | Semun Lee <sm79.lee@samsung.com> | 2016-07-07 20:10:16 +0900 |
---|---|---|
committer | Semun Lee <sm79.lee@samsung.com> | 2016-07-07 21:21:00 +0900 |
commit | 28e81640c7c8c6e4d1b2d1fb60748ce7b983a847 (patch) | |
tree | 55062863c7ea4273a7f9b2ea3eda659a518d5aba /client | |
parent | 45d05396088457b0f8aa1cfaa3969ecdeeea4ab4 (diff) | |
download | ui-gadget-1-28e81640c7c8c6e4d1b2d1fb60748ce7b983a847.tar.gz ui-gadget-1-28e81640c7c8c6e4d1b2d1fb60748ce7b983a847.tar.bz2 ui-gadget-1-28e81640c7c8c6e4d1b2d1fb60748ce7b983a847.zip |
Fix crash of ug-client appssubmit/tizen/20160707.122156accepted/tizen/wearable/20160707.225137accepted/tizen/tv/20160707.225121accepted/tizen/mobile/20160707.225105accepted/tizen/ivi/20160707.225154accepted/tizen/common/20160707.172213
dlopen ug shared library file again to prevent crash while terminating app.
In some case, unloaded memory could be accessed by other libaries clean up routine.
Fix double free of ad.name
Change-Id: I612c318ccb798d76a0ac8b77ab8f23dbe2b1e974
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
Diffstat (limited to 'client')
-rw-r--r-- | client/ug-client.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/client/ug-client.c b/client/ug-client.c index 38fe98f..bce59d5 100644 --- a/client/ug-client.c +++ b/client/ug-client.c @@ -20,8 +20,11 @@ */ #include <stdio.h> +#include <dlfcn.h> +#include <errno.h> #include <appcore-efl.h> #include <ui-gadget.h> +#include <ug-module.h> #include <dlog.h> #include <aul.h> @@ -492,9 +495,22 @@ func_out: static int app_terminate(void *data) { struct appdata *ad = data; + char *ug_file_path = NULL; + void *handle; + int ret; LOGD("app_terminate called"); + ret = ug_module_get_file_path(ad->name, &ug_file_path); + if (ret == 0) { + handle = dlopen(ug_file_path, RTLD_LAZY); + if (!handle) + LOGE("Failed to dlopen the ug file (%d)", errno); + } + + if (ug_file_path) + free(ug_file_path); + _ug_client_dbus_signal_handler_fini(data); evas_object_smart_callback_del(ad->win, "wm,rotation,changed", rotate); @@ -513,9 +529,6 @@ static int app_terminate(void *data) app_control_destroy(ad->request); - if (ad->name) - free(ad->name); - LOGD("app_terminate end"); return 0; |