Description: As per API documentation, mac_address should be freed using free().
But we are using glib allocator for allocating memory.
So, that allocated memory should be freed by g_free() only as per GLIB documentation.
Usage os g_strdup in API may lead to memory corruption, because memory allocated
using g_strdup should be freed using g_free.
So to match declaration in header file for wifi_manager_get_network_interface_name()
we should use strndup in place of g_strdup().
Change-Id: I0dc8df3aaa66f402075c6369964c9ae1919d562f
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Name: capi-network-wifi-manager
Summary: Network Wi-Fi library in TIZEN C API
-Version: 1.0.7
+Version: 1.0.8
Release: 1
Group: System/Network
License: Apache-2.0
}
net_profile_info_s *profile = (net_profile_info_s *)profile_iterator->data;
- *name = g_strdup(profile->net_info.DevName);
+ *name = strdup(profile->net_info.DevName);
if (*name == NULL)
return WIFI_MANAGER_ERROR_OUT_OF_MEMORY;
}
printf("Interface name : %s\n", if_name);
- g_free(if_name);
+ free(if_name);
return 1;
}