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 /src | |
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 'src')
-rw-r--r-- | src/module.c | 15 | ||||
-rw-r--r-- | src/ug.c | 11 |
2 files changed, 19 insertions, 7 deletions
diff --git a/src/module.c b/src/module.c index 2df10e2..b66e772 100644 --- a/src/module.c +++ b/src/module.c @@ -42,6 +42,11 @@ #define MEM_ADDR_LEN 8 #define MEM_ADDR_TOT_LEN 17 +#ifndef UG_API +#define UG_API __attribute__ ((visibility("default"))) +#endif + + static char *__ug_module_get_addr(const char *ug_name) { FILE *file; @@ -278,14 +283,12 @@ int ug_module_unload(struct ug_module *module) return 0; } -int ug_exist(const char* name) +UG_API int ug_module_get_file_path(const char *name, char **ug_file_path) { - int ret = 1; - - if (__get_ug_info(name, NULL) < 0) { + if (__get_ug_info(name, ug_file_path) < 0) { _ERR("error in getting ug file path"); - ret = 0; + return -1; } - return ret; + return 0; } @@ -377,12 +377,21 @@ UG_API int ug_disable_effect(ui_gadget_h ug) UG_API int ug_is_installed(const char *name) { + int ret = 1; + char *ug_file_path = NULL; + if (name == NULL) { _ERR("name is null"); return -1; } - return ug_exist(name); + if (!ug_module_get_file_path(name, &ug_file_path)) + ret = 0; + + if (ug_file_path) + free(ug_file_path); + + return ret; } #ifdef ENABLE_UG_CREATE_CB |