Fix coverity - dbus_connection_unref
[platform/core/uifw/stt.git] / server / sttd_dbus.c
index 99a29a2..28298be 100644 (file)
@@ -350,11 +350,6 @@ int sttdc_send_result(int uid, int event, const char** data, int data_count, con
 
 int sttdc_send_error_signal(int uid, int reason, const char *err_msg)
 {
-       if (NULL == err_msg) {
-               SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] Input parameter is NULL");
-               return STTD_ERROR_INVALID_PARAMETER;
-       }
-
        int pid = sttd_client_get_pid(uid);
        if (0 > pid) {
                SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] pid is NOT valid");
@@ -509,17 +504,14 @@ void __sttd_dbus_connection_free()
 {
        if (NULL != g_conn_listener) {
                dbus_connection_close(g_conn_listener);
-               dbus_connection_unref(g_conn_listener);
                g_conn_listener = NULL;
        }
        if (NULL != g_conn_sender) {
                dbus_connection_close(g_conn_sender);
-               dbus_connection_unref(g_conn_sender);
                g_conn_sender = NULL;
        }
        if (NULL != g_conn_custom) {
                dbus_connection_close(g_conn_custom);
-               dbus_connection_unref(g_conn_custom);
                g_conn_custom = NULL;
        }
 }
@@ -588,7 +580,7 @@ int __sttd_get_buxtonkey()
 
        __sttd_dbus_service_free();
 
-       if (NULL == engine_appid || NULL == engine_default || 0 == strncmp(engine_appid, engine_default, strlen(engine_appid))) {
+       if (NULL == engine_default || 0 == strncmp(engine_appid, engine_default, strlen(engine_appid))) {
                g_server_service_name = (char*)calloc(strlen(STT_SERVER_SERVICE_NAME) + 1, sizeof(char));
                if (g_server_service_name)
                        snprintf(g_server_service_name, strlen(STT_SERVER_SERVICE_NAME) + 1, "%s", STT_SERVER_SERVICE_NAME);
@@ -683,7 +675,6 @@ int __sttd_request_custom_dbus_name()
        }
 
        dbus_connection_close(g_conn_custom);
-       dbus_connection_unref(g_conn_custom);
        g_conn_custom = NULL;
 
        SLOG(LOG_DEBUG, TAG_STTD, "==");