int mc_db_update_icon_uri(const char *server_name, const char *uri)
{
int ret = MEDIA_CONTROLLER_ERROR_NONE;
+ char *_query = NULL;
char *sql_str = NULL;
mc_retvm_if(!server_name, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid server_name");
- mc_retvm_if(!uri, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Invalid uri");
- sql_str = g_strdup_printf("%s%s%s%s%s", MC_DB_CMD_UPDATE_ICON, MC_STRING_DELIMITER, server_name, MC_STRING_DELIMITER, uri);
+ _query = sqlite3_mprintf("UPDATE '%q' SET icon_uri=%Q;", server_name, uri);
+
+ sql_str = g_strdup_printf("%s%s%s", MC_DB_CMD_UPDATE_ICON, MC_STRING_DELIMITER, _query);
ret = __mc_db_update_db(MC_PRIV_TYPE_SERVER, sql_str);
+ SQLITE3_SAFE_FREE(_query);
MC_SAFE_FREE(sql_str);
return ret;
is_query_from_client = TRUE;
} else if (strncmp(MC_DB_CMD_UPDATE_ICON, params[0], strlen(MC_DB_CMD_UPDATE_ICON)) == 0) {
- if (params[2] == NULL) {
- mc_error("wrong query");
- ret = MEDIA_CONTROLLER_ERROR_INVALID_OPERATION;
- goto ERROR;
- }
-
- sql_str = sqlite3_mprintf("UPDATE '%q' SET icon_uri=%Q;", params[1], params[2]);
+ sql_str = params[1];
+ is_query_from_client = TRUE;
} else if (strncmp(MC_DB_CMD_UPDATE_ABILITY, params[0], strlen(MC_DB_CMD_UPDATE_ABILITY)) == 0) {
if (params[2] == NULL || params[3] == NULL) {