Fix coverity - dbus_connection_unref
[platform/core/uifw/stt.git] / server / sttd_dbus.c
index a16e12c..28298be 100644 (file)
@@ -504,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;
        }
 }
@@ -583,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);
@@ -678,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, "==");