[Fixed] memory allocated using g_try_malloc0_n should be freed using g_free() 28/56828/1 accepted/tizen/mobile/20160216.103627 accepted/tizen/tv/20160216.103641 accepted/tizen/wearable/20160216.103701 submit/tizen/20160216.061917 submit/tizen/20160216.090113 submit/tizen_common/20160218.142243
authorNishant Chaprana <n.chaprana@samsung.com>
Wed, 13 Jan 2016 03:48:44 +0000 (09:18 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 13 Jan 2016 03:48:44 +0000 (09:18 +0530)
Change-Id: Icb9386bc375b583626472ac467adefae1a3ee540
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/capi-network-wifi-direct.spec
src/wifi-direct-client-proxy.c

index 64d249994d409d8e2417966b29d5935cc77784a1..39bb5005a547c57244f1e8123f79079e257f8f9a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       capi-network-wifi-direct
 Summary:    Network WiFi-Direct Library
-Version:    1.2.45
+Version:    1.2.46
 Release:    1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
index 04464afa0585a15e056148a45326f3c8f70ebce9..3fbe6c1e6620d110fbfa373ed93e9821faa7e63e 100755 (executable)
@@ -1746,7 +1746,7 @@ int wifi_direct_foreach_discovered_peers(wifi_direct_discovered_peer_cb cb,
                }
                pthread_mutex_unlock(&g_client_info.mutex);
                if (res <= 0) {
-                       free(buff);
+                       g_free(buff);
                        WDC_LOGE("Failed to read socket");
                        __wfd_reset_control();
                        return WIFI_DIRECT_ERROR_OPERATION_FAILED;
@@ -2139,7 +2139,7 @@ int wifi_direct_foreach_connected_peers(wifi_direct_connected_peer_cb cb,
                                                                sizeof(wfd_connected_peer_info_s));
                pthread_mutex_unlock(&g_client_info.mutex);
                if (res <= 0) {
-                       free(buff);
+                       g_free(buff);
                        WDC_LOGE("socket read error");
                        __wfd_reset_control();
                        return WIFI_DIRECT_ERROR_OPERATION_FAILED;
@@ -3735,7 +3735,7 @@ int wifi_direct_foreach_persistent_groups(wifi_direct_persistent_group_cb cb,
                }
                pthread_mutex_unlock(&g_client_info.mutex);
                if (res <= 0) {
-                       free(buff);
+                       g_free(buff);
                        WDC_LOGE("socket read error.");
                        __wfd_reset_control();
                        return WIFI_DIRECT_ERROR_OPERATION_FAILED;
@@ -4263,11 +4263,11 @@ int wifi_direct_get_peer_info(char* mac_address, wifi_direct_discovered_peer_inf
 
        peer = (wifi_direct_discovered_peer_info_s *) g_try_malloc0(sizeof(wifi_direct_discovered_peer_info_s));
        if (!peer) {
-                       WDC_LOGE("Failed to alloc memory");
-                       pthread_mutex_unlock(&g_client_info.mutex);
-                       g_free(buff);
-                       return WIFI_DIRECT_ERROR_OPERATION_FAILED;
-               }
+               WDC_LOGE("Failed to alloc memory");
+               pthread_mutex_unlock(&g_client_info.mutex);
+               g_free(buff);
+               return WIFI_DIRECT_ERROR_OPERATION_FAILED;
+       }
        peer->device_name = g_strdup(buff->device_name);
        peer->mac_address = (char*) g_try_malloc0(MACSTR_LEN);
        g_snprintf(peer->mac_address, MACSTR_LEN, MACSTR, MAC2STR(buff->mac_address));