From 5c500d50a37e6d90bbf52f348249050540d44329 Mon Sep 17 00:00:00 2001 From: hj kim Date: Wed, 26 Dec 2018 14:32:15 +0900 Subject: [PATCH] Fix Coverity issues Change-Id: Ie63d53ed8665b43457a8a6201bdf909c9daef264 --- svc/media_controller_db_util.c | 2 ++ test/server_test/media_controller_server_test.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/svc/media_controller_db_util.c b/svc/media_controller_db_util.c index 5b97536..0ff0736 100755 --- a/svc/media_controller_db_util.c +++ b/svc/media_controller_db_util.c @@ -527,6 +527,7 @@ int mc_db_util_init_latest_server_table(void *handle) if (MC_STRING_VALID((const char *)sqlite3_column_text(stmt, 1))) { latest_server_name = strdup((const char *)sqlite3_column_text(stmt, 1)); mc_debug("latest_server_name: %s", latest_server_name); + break; } ret = sqlite3_step(stmt); } @@ -538,6 +539,7 @@ int mc_db_util_init_latest_server_table(void *handle) /* Update server_state and playback_state to 0 */ sql_str = sqlite3_mprintf("UPDATE '%q' SET server_state=%d, playback_state=%d;", latest_server_name, MC_SERVER_STATE_DEACTIVATE, MC_PLAYBACK_STATE_STOPPED); + MC_SAFE_FREE(latest_server_name); mc_retvm_if(!MC_STRING_VALID(sql_str), MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "SQL string is null"); ret = mc_db_util_update_db(handle, sql_str); diff --git a/test/server_test/media_controller_server_test.c b/test/server_test/media_controller_server_test.c index 12494ca..0cb89dc 100755 --- a/test/server_test/media_controller_server_test.c +++ b/test/server_test/media_controller_server_test.c @@ -301,6 +301,8 @@ static int __update_playlist(mc_server_h server, mc_playlist_update_mode_e mode) mc_debug("Get playlist [%s]", playlist_name); MC_SAFE_FREE(playlist_name); + + ret = mc_playlist_destroy(playlist_2); } } else { -- 2.7.4