When a discovery client has set a pattern as filter the code allocates
the string so it needs to be freed with the filter otherwise it leads to
the following leak:
10 bytes in 2 blocks are definitely lost in loss record 19 of 265
at 0x483980B: malloc (vg_replace_malloc.c:309)
by 0x4D9FF7E: strdup (in /usr/lib64/libc-2.30.so)
by 0x1FC8E7: parse_pattern (adapter.c:2454)
by 0x1FF37B: parse_discovery_filter_entry (adapter.c:2480)
by 0x1FF37B: parse_discovery_filter_dict (adapter.c:2538)
by 0x2020AF: set_discovery_filter (adapter.c:2589)
by 0x24AD63: process_message.isra.0 (object.c:259)
by 0x24B40F: generic_message (object.c:1079)
by 0x4A670B7: ??? (in /usr/lib64/libdbus-1.so.3.19.11)
by 0x4A57763: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.19.11)
by 0x2459CF: message_dispatch (mainloop.c:72)
by 0x4963E8A: ??? (in /usr/lib64/libglib-2.0.so.0.6200.6)
by 0x496756F: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.6200.6)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
return;
g_slist_free_full(discovery_filter->uuids, free);
+ free(discovery_filter->pattern);
g_free(discovery_filter);
}