This patch allocates newly created group's memory using g_try_malloc0
because the memory for group is freed using g_free() in wfd_destroy_group().
If the allocator and destructor funciton of memory are different
then chances of memory corruption are present because glib maintains its own
memory allocation pool.
Change-Id: I995376f9d1349df06ca3866ac7caab4b25f88bba
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Name: wifi-direct-manager
Summary: Wi-Fi Direct manger
-Version: 1.2.130
+Version: 1.2.131
Release: 1
Group: Network & Connectivity/Wireless
License: Apache-2.0
}
errno = 0;
- group = (wfd_group_s*) calloc(1, sizeof(wfd_group_s));
+ group = (wfd_group_s*) g_try_malloc0(sizeof(wfd_group_s));
if (!group) {
WDS_LOGE("Failed to allocate memory for group. [%s]", strerror(errno));
__WDS_LOG_FUNC_EXIT__;