From: bhutani.92 Date: Thu, 16 Jun 2016 12:42:22 +0000 (+0530) Subject: [UG-MYFILE-EFL] Fixed SVACE Erros X-Git-Tag: submit/tizen_mobile/20160616.151022^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c263a12ba1af84cbfbad5bdc6f0d3e2c796cf3ae;p=profile%2Fmobile%2Fapps%2Fnative%2Fug-myfile-efl.git [UG-MYFILE-EFL] Fixed SVACE Erros Change-Id: I512cfea5ccbf7984d5902a5b2c9b88a40a3f255f Signed-off-by: bhutani.92 --- diff --git a/inc/mf-ug-fs-util.h b/inc/mf-ug-fs-util.h index c5e14d2..e03ac7d 100644 --- a/inc/mf-ug-fs-util.h +++ b/inc/mf-ug-fs-util.h @@ -48,15 +48,17 @@ static inline char *Get_Parent_Path(int storage_id) char *path = NULL; char *storage_path = NULL; storage_get_root_directory(storage_id, &path); - if (!strcmp(path, "(null)")) { + if (!path) { + return NULL; + } else if (!strcmp(path, "(null)")) { ug_debug("path is null"); free(path); return NULL; } else if (path) { ug_debug("path is %s", path); mf_ug_file_attr_get_parent_path(path, &storage_path); - free(path); } + free(path); return storage_path; } /* File system related value definition */ diff --git a/src/common/mf-ug-fm-svc-wapper.c b/src/common/mf-ug-fm-svc-wapper.c index 27b874f..9cee37a 100644 --- a/src/common/mf-ug-fm-svc-wapper.c +++ b/src/common/mf-ug-fm-svc-wapper.c @@ -410,6 +410,9 @@ char *mf_ug_fm_svc_path_info_translate(char *path_info, int path_info_max_len) char *output = NULL; void *pnode = NULL; char *omit = MF_UG_PATH_INFO_TRANS_OMIT; + if (!omit) { + return NULL; + } if (strlen(path_info) < path_info_max_len) { UG_SAFE_FREE_CHAR(omit); @@ -486,6 +489,9 @@ char *mf_ug_fm_svc_path_info_translate(char *path_info, int path_info_max_len) char *temp = NULL; char *sep = MF_UG_PATH_INFO_SEP; EINA_LIST_FOREACH(temp_list, l, pnode) { + if (!pnode) { + continue; + } ug_pNode *node = (ug_pNode *)pnode; temp = output; if (node->flag_trans == TRUE) { @@ -943,6 +949,7 @@ Eina_List *mf_ug_fm_svc_wrapper_level_path_get(const char *original_path) ug_mf_retvm_if(original_path == NULL, NULL, "input path is NULL"); char *current_path = g_strdup(original_path); + char *temp_path = current_path; Eina_List *path_list = NULL; const char *root_path = NULL; @@ -980,6 +987,7 @@ Eina_List *mf_ug_fm_svc_wrapper_level_path_get(const char *original_path) path_list = eina_list_append(path_list, g_strdup(original_path)); } UG_TRACE_END; + UG_SAFE_FREE_CHAR(temp_path); return path_list; }