diff mbox series

[Bluez,v4,4/4] shared/mgmt: Fix memory leak in mgmt_tlv_list

Message ID 20210105111219.Bluez.v4.4.I43884adadc00a5095dd03d2261a71dc2ba80d986@changeid
State New
Headers show
Series None | expand

Commit Message

Howard Chung Jan. 5, 2021, 3:12 a.m. UTC
This patch freed the mgmt_tlv properly in mgmt_tlv_list_free.

Reviewed-by: apusaka@chromium.org
Reviewed-by: mcchou@chromium.org
---

Changes in v4:
- Simply use free instead of mgmt_tlv_free

Changes in v2:
- Fix incompatible pointer type error of mgmt_tlv_free

 src/shared/mgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c
index dc8107846668..3e9b9ee26472 100644
--- a/src/shared/mgmt.c
+++ b/src/shared/mgmt.c
@@ -595,7 +595,7 @@  static void mgmt_tlv_free(struct mgmt_tlv *entry)
 
 void mgmt_tlv_list_free(struct mgmt_tlv_list *tlv_list)
 {
-	queue_destroy(tlv_list->tlv_queue, NULL);
+	queue_destroy(tlv_list->tlv_queue, free);
 	free(tlv_list);
 }