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));
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);
}
}