diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-06-11 13:16:29 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2020-06-11 13:45:03 -0700 |
commit | e468284ada70e7b87ebc136ca4be5677cece6415 (patch) | |
tree | 41053cbeaadb7a0979f1f6c2a5b83e1fb2ff2348 /src/adapter.c | |
parent | 227cfdf8e01f639f74b36b179f8ccf9a2061e932 (diff) | |
download | bluez-e468284ada70e7b87ebc136ca4be5677cece6415.tar.gz |
adapter: Fix leaking filter pattern
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)
Diffstat (limited to 'src/adapter.c')
-rw-r--r-- | src/adapter.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/adapter.c b/src/adapter.c index c9ce6b571..dd1cb36ab 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1468,6 +1468,7 @@ static void free_discovery_filter(struct discovery_filter *discovery_filter) return; g_slist_free_full(discovery_filter->uuids, free); + free(discovery_filter->pattern); g_free(discovery_filter); } |