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>
}
mac[12] = '\0';
*mac_address = g_strdup(mac);
+ g_free(tmp);
return TRUE;
}