Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k/nubus Avoid memory leak in netdock_get.



details:   https://anonhg.NetBSD.org/src/rev/be18801ab568
branches:  trunk
changeset: 825736:be18801ab568
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Jul 29 02:17:44 2017 +0000

description:
Avoid memory leak in netdock_get.

If top is null, this is the first time through and nothing else will
free m.

>From Ilja Van Sprundel.

diffstat:

 sys/arch/mac68k/nubus/if_netdock_nubus.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r dab2eed27b4a -r be18801ab568 sys/arch/mac68k/nubus/if_netdock_nubus.c
--- a/sys/arch/mac68k/nubus/if_netdock_nubus.c  Sat Jul 29 01:54:56 2017 +0000
+++ b/sys/arch/mac68k/nubus/if_netdock_nubus.c  Sat Jul 29 02:17:44 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_netdock_nubus.c,v 1.25 2016/12/15 09:28:03 ozaki-r Exp $    */
+/*     $NetBSD: if_netdock_nubus.c,v 1.26 2017/07/29 02:17:44 riastradh Exp $  */
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato <daishi%axlight.com@localhost>
@@ -43,7 +43,7 @@
 /***********************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.25 2016/12/15 09:28:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.26 2017/07/29 02:17:44 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -802,6 +802,8 @@
                        if ((m->m_flags & M_EXT) == 0) {
                                if (top)
                                        m_freem(top);
+                               else
+                                       m_freem(m);
                                return (NULL);
                        }
                        len = MCLBYTES;



Home | Main Index | Thread Index | Old Index