Module Name:    src
Committed By:   roy
Date:           Fri Apr 20 15:29:19 UTC 2018

Modified Files:
        src/usr.sbin/rtadvd: config.c

Log Message:
Ensure that the soliciter list is initialised and freed correctly, even if it's 
not used yet.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/usr.sbin/rtadvd/config.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/rtadvd/config.c
diff -u src/usr.sbin/rtadvd/config.c:1.38 src/usr.sbin/rtadvd/config.c:1.39
--- src/usr.sbin/rtadvd/config.c:1.38	Fri Apr 20 10:39:37 2018
+++ src/usr.sbin/rtadvd/config.c	Fri Apr 20 15:29:19 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: config.c,v 1.38 2018/04/20 10:39:37 roy Exp $	*/
+/*	$NetBSD: config.c,v 1.39 2018/04/20 15:29:19 roy Exp $	*/
 /*	$KAME: config.c,v 1.93 2005/10/17 14:40:02 suz Exp $	*/
 
 /*
@@ -104,6 +104,7 @@ encode_domain(char *dst, const char *src
 void
 free_rainfo(struct rainfo *rai)
 {
+	struct soliciter *sol;
 	struct prefix *pfx;
 	struct rtinfo *rti;
 	struct rdnss *rdnss;
@@ -113,6 +114,11 @@ free_rainfo(struct rainfo *rai)
 
 	rtadvd_remove_timer(&rai->timer);
 
+	while ((sol = TAILQ_FIRST(&rai->soliciter))) {
+		TAILQ_REMOVE(&rai->soliciter, sol, next);
+		free(sol);
+	}
+
 	while ((pfx = TAILQ_FIRST(&rai->prefix))) {
 		TAILQ_REMOVE(&rai->prefix, pfx, next);
 		free(pfx);
@@ -206,6 +212,7 @@ getconfig(const char *intface, int exith
 	}
 
 	ELM_MALLOC(tmp);
+	TAILQ_INIT(&tmp->soliciter);
 	TAILQ_INIT(&tmp->prefix);
 	TAILQ_INIT(&tmp->route);
 	TAILQ_INIT(&tmp->rdnss);

Reply via email to