diff mbox series

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

Message ID 20201228144543.Bluez.v1.4.I43884adadc00a5095dd03d2261a71dc2ba80d986@changeid
State Superseded
Headers show
Series [Bluez,v1,1/4] shared/mgmt: Add supports of parsing mgmt tlv list | expand

Commit Message

Howard Chung Dec. 28, 2020, 6:46 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
---

 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 bdc4bdd9e66b..19b5466f9071 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, mgmt_tlv_free);
 	free(tlv_list);
 }