From f2de3240f6019ef5587713d78f766e2850b620ad Mon Sep 17 00:00:00 2001 From: Yu Jiung Date: Fri, 14 Oct 2016 14:36:09 +0900 Subject: [PATCH] Fix SVace issues Change-Id: I146769cb5f163a3176531ad7559de17f17efd171 Signed-off-by: Yu jiung --- packaging/asp-manager.spec | 2 +- src/asp-manager-gdbus.c | 3 ++- src/session/asp-session.c | 10 ++-------- src/tech/asp-tech-infra.c | 6 +----- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/packaging/asp-manager.spec b/packaging/asp-manager.spec index 330a1cb..f2ecafd 100755 --- a/packaging/asp-manager.spec +++ b/packaging/asp-manager.spec @@ -1,6 +1,6 @@ Name: asp-manager Summary: ASP(application service platform) manager -Version: 0.0.12 +Version: 0.0.13 Release: 2 Group: Network & Connectivity/Other License: Apache-2.0 diff --git a/src/asp-manager-gdbus.c b/src/asp-manager-gdbus.c index 94e65d6..d9ebe5d 100755 --- a/src/asp-manager-gdbus.c +++ b/src/asp-manager-gdbus.c @@ -544,6 +544,7 @@ static gboolean __asp_manager_gdbus_connect_session(AspSession *object, out: g_variant_iter_free(iter); + g_free(session_info); __ASP_LOG_FUNC_EXIT__; return TRUE; } @@ -893,7 +894,7 @@ static gboolean __asp_manager_gdbus_release_port(AspSession *object, } ASP_LOGD("session ID [%u] session mac [%s]", session_id, session_mac); - macaddr_atoe(session_mac, mac_addr); + res = macaddr_atoe(session_mac, mac_addr); if (!res) { ASP_LOGE("Operation Failed"); ASP_RETURN_SESSION_ERR(invocation, -ASP_ERROR_OPERATION_FAILED); diff --git a/src/session/asp-session.c b/src/session/asp-session.c index 7371d07..36988f3 100644 --- a/src/session/asp-session.c +++ b/src/session/asp-session.c @@ -913,7 +913,7 @@ void asp_session_recv_req(GSocketAddress *sock_addr, gpointer p_msg) asp_session_s *session = _get_exist_session(p_header->session_id, p_header->session_mac); - if (!session->over_p2p && NULL == session && + if (!session && ASP_OPCODE_REQUEST_SESSION != p_header->opcode) { /* over infra */ /* NACK shall be sent */ @@ -921,13 +921,7 @@ void asp_session_recv_req(GSocketAddress *sock_addr, gpointer p_msg) return; } - if (session->over_p2p && NULL == session) { - /* over p2p */ - _send_nack(sock_addr, p_header->seq_num, ASP_NACK_REASON_NO_SESSION_EXIST); - return; - } - - if (session->over_p2p && session->sock_addr == NULL) { + if(session && session->over_p2p && session->sock_addr == NULL) { ASP_LOGD("IpAssigned signal isn't yet received, discard event"); return; } diff --git a/src/tech/asp-tech-infra.c b/src/tech/asp-tech-infra.c index a0fd4f6..3127780 100644 --- a/src/tech/asp-tech-infra.c +++ b/src/tech/asp-tech-infra.c @@ -407,16 +407,12 @@ gint32 asp_tech_infra_advertise(asp_service_advertise_s *service, gint32 replace } /* Add MAC Address to TXT record */ - mac_addr = (gchar *)g_try_malloc0(ASP_SERVICE_MACSTR_LEN + 1); - if (mac_addr == NULL) { - ASP_LOGE("Failed to malloc"); - return ASP_ERROR_MEMORY; - } mac_addr = vconf_get_str(VCONFKEY_WIFI_BSSID_ADDRESS); mac_addr_len = strlen(mac_addr); result = __add_txt_record(service_handle, ASP_INFRA_MAC_ADDR_KEY, mac_addr, mac_addr_len); if (result != DNSSD_ERROR_NONE) { result = __asp_service_infra_convert_error_type(result); + g_free(mac_addr); return result; } g_free(mac_addr); -- 2.7.4