diff mbox series

[2/3] icmp6: fix memory leaks with dns_list/domains

Message ID 20240531145554.601087-2-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/3] acd: move l_acd_stop ahead of EVENT_CONFLICT | expand

Commit Message

James Prestwood May 31, 2024, 2:55 p.m. UTC
Both of these lists were never freed upon freeing the router object
---
 ell/icmp6.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/ell/icmp6.c b/ell/icmp6.c
index d94127e..d352955 100644
--- a/ell/icmp6.c
+++ b/ell/icmp6.c
@@ -787,8 +787,16 @@  struct l_icmp6_router *_icmp6_router_new()
 
 void _icmp6_router_free(struct l_icmp6_router *r)
 {
+	unsigned int i;
+
 	l_free(r->routes);
 	l_free(r->ac_prefixes);
+	l_free(r->dns_list);
+
+	for (i = 0; i < r->n_domains; i++)
+		l_free(r->domains[i].domain);
+
+	l_free(r->domains);
 	l_free(r);
 }