Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xen Fix memory leak if the provided mac address...



details:   https://anonhg.NetBSD.org/src/rev/b0769f0ece6a
branches:  trunk
changeset: 790758:b0769f0ece6a
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Oct 20 11:37:53 2013 +0000

description:
Fix memory leak if the provided mac address isn't valid.

diffstat:

 sys/arch/xen/xen/xennetback_xenbus.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 854ac7757b6e -r b0769f0ece6a sys/arch/xen/xen/xennetback_xenbus.c
--- a/sys/arch/xen/xen/xennetback_xenbus.c      Sun Oct 20 11:37:11 2013 +0000
+++ b/sys/arch/xen/xen/xennetback_xenbus.c      Sun Oct 20 11:37:53 2013 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xennetback_xenbus.c,v 1.51 2013/03/06 11:37:23 yamt Exp $      */
+/*      $NetBSD: xennetback_xenbus.c,v 1.52 2013/10/20 11:37:53 bouyer Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.51 2013/03/06 11:37:23 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xennetback_xenbus.c,v 1.52 2013/10/20 11:37:53 bouyer Exp $");
 
 #include "opt_xen.h"
 
@@ -288,6 +288,7 @@
                if ((e[0] == '\0' && i != 5) && e[0] != ':') {
                        aprint_error_ifnet(ifp,
                            "%s is not a valid mac address\n", val);
+                       free(val, M_DEVBUF);
                        err = EINVAL;
                        goto fail;
                }



Home | Main Index | Thread Index | Old Index