Fixed memory leak 53/188253/1
authorSaurav Babu <saurav.babu@samsung.com>
Mon, 3 Sep 2018 10:02:21 +0000 (15:32 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Mon, 3 Sep 2018 10:02:21 +0000 (15:32 +0530)
commitbc81181783119a429ca5eddf200ab002e69d673f
treecba5f1b8d9487f520b5ba8db76c0c91f43f27925
parent3994e96eb14f7f478acf8047ce1f0f60c3900917
Fixed memory leak

g_ascii_strdown() returns a newly allocated string and should be freed
with g_free().
Below is the valgrind report complaining about the leak
==7455== 216 bytes in 12 blocks are definitely lost in loss record 3,009 of 3,068
==7455==    at 0x48458A4: malloc (vg_replace_malloc.c:299)
==7455==    by 0x4AB11B3: g_malloc (gmem.c:94)
==7455==    by 0x4ACBF73: g_strndup (gstrfuncs.c:425)
==7455==    by 0x4ACC9A7: g_ascii_strdown (gstrfuncs.c:1517)
==7455==    by 0x12F0E7: __get_mac_address (wifi-config.c:180)
==7455==    by 0x12F0E7: __get_group_name.constprop.4 (wifi-config.c:199)
==7455==    by 0x12F75B: _load_configuration (wifi-config.c:312)
==7455==    by 0x13133D: handle_load_configuration (wifi-config.c:1052)
==7455==    by 0x4E40AF7: ffi_call_SYSV (in /usr/lib/libffi.so.6.0.2)

Change-Id: I979c0daef4572a3a77a2f75e81ccfea0c8781fe0
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
src/wifi-config.c