Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/netinet Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/adb03d71916f
branches:  netbsd-8
changeset: 434786:adb03d71916f
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Mar 30 11:12:15 2018 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #661):

        sys/netinet/ip_encap.c: revision 1.67

Fix memory leak, found by Mootja.

diffstat:

 sys/netinet/ip_encap.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 3dd908770731 -r adb03d71916f sys/netinet/ip_encap.c
--- a/sys/netinet/ip_encap.c    Fri Mar 30 11:10:14 2018 +0000
+++ b/sys/netinet/ip_encap.c    Fri Mar 30 11:12:15 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_encap.c,v 1.65.2.1 2017/12/10 09:41:31 snj Exp $    */
+/*     $NetBSD: ip_encap.c,v 1.65.2.2 2018/03/30 11:12:15 martin Exp $ */
 /*     $KAME: ip_encap.c,v 1.73 2001/10/02 08:30:58 itojun Exp $       */
 
 /*
@@ -68,7 +68,7 @@
 #define USE_RADIX
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.65.2.1 2017/12/10 09:41:31 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.65.2.2 2018/03/30 11:12:15 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mrouting.h"
@@ -822,7 +822,7 @@
 
        error = encap_add(ep);
        if (error)
-               goto fail;
+               goto gc;
 
        error = 0;
 #ifndef ENCAP_MPSAFE
@@ -830,6 +830,8 @@
 #endif
        return ep;
 
+gc:
+       kmem_free(ep, sizeof(*ep));
 fail:
 #ifndef ENCAP_MPSAFE
        splx(s);



Home | Main Index | Thread Index | Old Index