Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Added m_freem for safety



details:   https://anonhg.NetBSD.org/src/rev/c6e13ea0a6fc
branches:  trunk
changeset: 379042:c6e13ea0a6fc
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu May 06 02:05:09 2021 +0000

description:
Added m_freem for safety

pointed out by knakahara@, thanks.

diffstat:

 sys/net/if_spppsubr.c |  13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r c42c91561b51 -r c6e13ea0a6fc sys/net/if_spppsubr.c
--- a/sys/net/if_spppsubr.c     Thu May 06 01:09:43 2021 +0000
+++ b/sys/net/if_spppsubr.c     Thu May 06 02:05:09 2021 +0000
@@ -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;
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index