From 6012d7baafb7c4acbba2bc06bd438f7eaa445e0a Mon Sep 17 00:00:00 2001 From: Nishant Chaprana Date: Sat, 30 Jan 2016 15:52:27 +0530 Subject: [PATCH] Fixed memory leak: iterator should freed using g_variant_iter_free Change-Id: I70b18a2971bc41c0197b4886cb96a986e2f9f7a3 Signed-off-by: Nishant Chaprana --- packaging/wifi-direct-manager.spec | 2 +- plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packaging/wifi-direct-manager.spec b/packaging/wifi-direct-manager.spec index 7496f10..d5f8cde 100755 --- a/packaging/wifi-direct-manager.spec +++ b/packaging/wifi-direct-manager.spec @@ -1,6 +1,6 @@ Name: wifi-direct-manager Summary: Wi-Fi Direct manger -Version: 1.2.122 +Version: 1.2.123 Release: 1 Group: Network & Connectivity/Wireless License: Apache-2.0 diff --git a/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c b/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c index 3cbde4b..266de0e 100755 --- a/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c +++ b/plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c @@ -1031,6 +1031,7 @@ void __ws_extract_servicediscoveryresponse_details(const char *key, GVariant *va memset(service_hex, 0x0, WS_MAX_SERVICE_LEN); while (g_variant_iter_loop (iter, "y", &service_hex[byte_length])) byte_length++; + g_variant_iter_free(iter); __ws_extract_peer_service(event, service_hex, byte_length); } @@ -1958,6 +1959,7 @@ static void __ws_parse_peer_joined(char *peer_path, #ifdef TIZEN_FEATURE_IP_OVER_EAPOL for(i = 0; i < OEM_IPADDR_LEN; i++) g_variant_iter_loop (iter, "y", &ip_addr[i]); + g_variant_iter_free(iter); WDP_LOGD("peer ip [" IPSTR "]", IP2STR(ip_addr)); #endif /* TIZEN_FEATURE_IP_OVER_EAPOL */ @@ -4165,9 +4167,10 @@ void __ws_extract_p2pdevice_details(const char *key, GVariant *value, void *user SUPPLICANT_P2P_PERSISTENTGROUP, __parsing_networks, &networks[num]); num++; } + networks[0].total = num; WDP_LOGE("total number [%d]", num); - + g_variant_iter_free(iter); } __WDP_LOG_FUNC_EXIT__; } -- 2.7.4