Fix SVACE issues 18/152118/1
authorRavi Kiran K N <ravi.kiran@samsung.com>
Mon, 25 Sep 2017 06:05:35 +0000 (11:35 +0530)
committerRavi Kiran K N <ravi.kiran@samsung.com>
Mon, 25 Sep 2017 06:05:35 +0000 (11:35 +0530)
Change-Id: I483b71894ca596f9c899cd08dd577be2135bec75
Signed-off-by: Ravi Kiran K N <ravi.kiran@samsung.com>
src/common/file-system/mf-file-attr.c
src/widget/mf-category-view.c

index ef5aeac..f15db29 100644 (file)
@@ -1107,11 +1107,13 @@ int mf_file_attr_get_file_icon(const char *file_path, int *error_code,
                int err_code = mf_file_attr_get_file_ext(file_path, &ext);
                if (err_code != MYFILE_ERR_NONE || ext == NULL) {
                        mf_warning("Fail to get file extension");
+                       SAFE_FREE_CHAR(icon_path);
                        return thumbnail_type;
                }
                retcode = mime_type_get_mime_type(ext, &mime);
                if ((mime == NULL) || (retcode != MIME_TYPE_ERROR_NONE)) {
                        mf_warning("Fail to get mime type, set etc icon");
+                       SAFE_FREE_CHAR(icon_path);
                        SAFE_FREE_CHAR(ext);
                        return thumbnail_type;
                }
@@ -1141,9 +1143,8 @@ int mf_file_attr_get_file_icon(const char *file_path, int *error_code,
                        memset(&tmp_data, 0x00, sizeof(mf_transfer_data_s));
                        tmp_data.file_path = file_path;
                        tmp_data.media = media_info;
-                       char *condition = NULL;
-                       condition =
-                               g_strdup_printf("%s and MEDIA_PATH=\"%s\"",
+                       char condition[4096];
+                       g_sprintf("%s and MEDIA_PATH=\"%s\"",
                                                                MF_CONDITION_IMAGE_VIDEO,
                                                                tmp_data.file_path);
                        err =
index ec403d9..9845c6f 100644 (file)
@@ -1030,6 +1030,7 @@ int mf_category_view_item_count_get(int type)
        }
        int count = 0;
        count = mf_media_content_data_count_get(condition);
+       SAFE_FREE_CHAR(condition);
        return count;
 }