Add the session timer to handle the exception case
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-gap-agent.c
index 150a1f0..dccf480 100644 (file)
@@ -112,8 +112,6 @@ gboolean _gap_agent_register_osp_server(GapAgentPrivate *agent,
                return FALSE;
 
        server = g_malloc0(sizeof(bt_agent_osp_server_t));
-       retv_if(server == NULL, FALSE);
-
        server->type = type;
        if (type == BT_RFCOMM_SERVER) {
                server->uuid = g_strdup(uuid);
@@ -1116,8 +1114,8 @@ void _gap_agent_setup_dbus(GapAgentPrivate *agent, GAP_AGENT_FUNC_CB *func_cb,
                priv->busname = NULL;
        } else {
                priv->busname = g_strdup(g_dbus_proxy_get_name(proxy));
-               g_object_unref(proxy);
                BT_DBG("Busname: %s", priv->busname);
+               g_object_unref(proxy);
        }
 
 }