diff options
author | Anjali Nijhara <a.nijhara@samsung.com> | 2023-10-18 15:58:01 +0530 |
---|---|---|
committer | Anjali Nijhara <a.nijhara@samsung.com> | 2023-10-18 15:58:01 +0530 |
commit | 6abd05952fc7b78bf07266eaaf4659b549044125 (patch) | |
tree | 14787ec6816dd59fd86fb680c4d6ae7d6bfff4a7 | |
parent | 287b39a54e17a3b4bcd400fd89e57d4bc4449b92 (diff) | |
download | connman-6abd05952fc7b78bf07266eaaf4659b549044125.tar.gz connman-6abd05952fc7b78bf07266eaaf4659b549044125.tar.bz2 connman-6abd05952fc7b78bf07266eaaf4659b549044125.zip |
Fix memory leak
Change-Id: I6c90014c1b2ee873d2fcb425f7bfff29e55d2224
-rwxr-xr-x | gsupplicant/supplicant.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c index 0f44766d..0c38ad3d 100755 --- a/gsupplicant/supplicant.c +++ b/gsupplicant/supplicant.c @@ -4364,10 +4364,20 @@ static void signal_network_removed(const char *path, DBusMessageIter *iter) interface_network_removed(iter, interface); } + #if defined TIZEN_EXT -void *copy_vsie_list(gconstpointer src, gpointer data) +gpointer copy_vsie_list(gconstpointer src, gpointer data) { - return g_strdup(src); + unsigned char *str = (unsigned char *)src; + unsigned char *vsie; + vsie = g_try_malloc0(str[1]+2); + + if (vsie) + memcpy(vsie, str, str[1]+2); + else + SUPPLICANT_DBG("Failed to allocate memory"); + + return vsie; } #endif |