Module Name:    src
Committed By:   yamaguchi
Date:           Thu May  6 02:05:09 UTC 2021

Modified Files:
        src/sys/net: if_spppsubr.c

Log Message:
Added m_freem for safety

pointed out by knakahara@, thanks.


To generate a diff of this commit:
cvs rdiff -u -r1.228 -r1.229 src/sys/net/if_spppsubr.c

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

Modified files:

Index: src/sys/net/if_spppsubr.c
diff -u src/sys/net/if_spppsubr.c:1.228 src/sys/net/if_spppsubr.c:1.229
--- src/sys/net/if_spppsubr.c:1.228	Wed Apr 28 09:39:39 2021
+++ src/sys/net/if_spppsubr.c	Thu May  6 02:05:09 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_spppsubr.c,v 1.228 2021/04/28 09:39:39 yamaguchi Exp $	 */
+/*	$NetBSD: if_spppsubr.c,v 1.229 2021/05/06 02:05:09 yamaguchi Exp $	 */
 
 /*
  * Synchronous PPP/Cisco link level subroutines.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.228 2021/04/28 09:39:39 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.229 2021/05/06 02:05:09 yamaguchi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1632,6 +1632,15 @@ sppp_cp_fini(const struct cp *cp, struct
 
 	callout_halt(&scp->ch, NULL);
 	callout_destroy(&scp->ch);
+
+	if (scp->mbuf_confreq != NULL) {
+		m_freem(scp->mbuf_confreq);
+		scp->mbuf_confreq = NULL;
+	}
+	if (scp->mbuf_confnak != NULL) {
+		m_freem(scp->mbuf_confnak);
+		scp->mbuf_confnak = NULL;
+	}
 }
 
 /*

Reply via email to