[UG-MYFILE-EFL] Fixed SVACE Erros 91/75091/1 submit/tizen_mobile/20160616.151022
authorbhutani.92 <bhutani.92@samsung.com>
Thu, 16 Jun 2016 12:42:22 +0000 (18:12 +0530)
committerbhutani.92 <bhutani.92@samsung.com>
Thu, 16 Jun 2016 12:42:22 +0000 (18:12 +0530)
Change-Id: I512cfea5ccbf7984d5902a5b2c9b88a40a3f255f
Signed-off-by: bhutani.92 <bhutani.92@samsung.com>
inc/mf-ug-fs-util.h
src/common/mf-ug-fm-svc-wapper.c

index c5e14d2..e03ac7d 100644 (file)
@@ -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    */
index 27b874f..9cee37a 100644 (file)
@@ -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;
 }