From 5a61addd894a5a5e485aa1dc8bf5ae03b4cc246f Mon Sep 17 00:00:00 2001 From: hj kim Date: Fri, 4 May 2018 11:31:09 +0900 Subject: [PATCH] Coverity issue fix Change-Id: I728bf41141647834063e370ff2fa357d2431a00a --- src/media_controller_db.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/media_controller_db.c b/src/media_controller_db.c index 7540d66..eba136d 100755 --- a/src/media_controller_db.c +++ b/src/media_controller_db.c @@ -126,6 +126,8 @@ static int __db_get_playlist(void *handle, const char *server_name, char **playl mc_retvm_if(handle == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL"); mc_retvm_if(server_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "server_name is NULL"); + mc_retvm_if(playlist_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "playlist_name is NULL"); + mc_retvm_if(playlist == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "playlist is NULL"); sql_str = sqlite3_mprintf("SELECT * from %s WHERE server_name = %Q", MC_DB_TABLE_PLAYLIST, server_name); mc_retvm_if(!MC_STRING_VALID(sql_str), MEDIA_CONTROLLER_ERROR_INVALID_OPERATION, "SQL string is null"); @@ -173,13 +175,8 @@ static int __db_get_playlist(void *handle, const char *server_name, char **playl MC_SAFE_FREE(_raw_data); - if (playlist_name != NULL && playlist != NULL) { - *playlist_name = _name; - *playlist = _bundle_data; - } else { - mc_retvm_if(playlist_name == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "playlist_name is null"); - mc_retvm_if(playlist == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "playlist is null"); - } + *playlist_name = _name; + *playlist = _bundle_data; return MEDIA_CONTROLLER_ERROR_NONE; } -- 2.7.4