Fix coverity issue 29/214529/1 accepted/tizen/unified/20190925.033556 submit/tizen/20190924.014546
authorMinje Ahn <minje.ahn@samsung.com>
Tue, 24 Sep 2019 01:09:38 +0000 (10:09 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 24 Sep 2019 01:09:38 +0000 (10:09 +0900)
Change-Id: I961b547e0c4b73c444a3a406a88bed3351f054b4
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/common/media-common-db-svc.c
src/scanner/media-scanner-scan.c

index 0215680..80210ce 100755 (executable)
@@ -385,7 +385,11 @@ int ms_delete_invalid_items(sqlite3 *handle, const char *storage_id, uid_t uid)
        MS_DBG_SLOG("[SQL query] : %s", sql);
 
        ret = media_db_get_result(handle, sql, &sql_stmt);
-       MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Query failed. err[%d]", ret);
+       if (ret != MS_MEDIA_ERR_NONE) {
+               MS_DBG_ERR("Query failed. err[%d]", ret);
+               g_ptr_array_free(thumb_list, TRUE);
+               return ret;
+       }
 
        while (sqlite3_step(sql_stmt) == SQLITE_ROW) {
                path = g_strdup((const char *)sqlite3_column_text(sql_stmt, 0));
index 3bf7200..989252b 100755 (executable)
@@ -129,7 +129,9 @@ static int __msc_dir_scan(sqlite3 *handle, const char *storage_id, char *start_p
                                if (is_recursive) {
                                        g_ptr_array_add(dir_array, path);
                                } else {
-                                       ms_insert_folder(handle, storage_id, path, uid);
+                                       ret = ms_insert_folder(handle, storage_id, path, uid);
+                                       if (ret != MS_MEDIA_ERR_NONE)
+                                               MS_DBG_ERR("ms_insert_folder failed");
                                        MS_SAFE_FREE(path);
                                }
                        }