Source-Changes-HG archive

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

[src/trunk]: src/sys/kern CID/980000: missing va_end()



details:   https://anonhg.NetBSD.org/src/rev/296d8cb322a3
branches:  trunk
changeset: 784765:296d8cb322a3
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Feb 09 01:20:08 2013 +0000

description:
CID/980000: missing va_end()

diffstat:

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

diffs (30 lines):

diff -r bb46285f8f6c -r 296d8cb322a3 sys/kern/kern_sysctl.c
--- a/sys/kern/kern_sysctl.c    Sat Feb 09 01:19:05 2013 +0000
+++ b/sys/kern/kern_sysctl.c    Sat Feb 09 01:20:08 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_sysctl.c,v 1.239 2013/02/02 14:02:09 matt Exp $   */
+/*     $NetBSD: kern_sysctl.c,v 1.240 2013/02/09 01:20:08 christos Exp $       */
 
 /*-
  * Copyright (c) 2003, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.239 2013/02/02 14:02:09 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_sysctl.c,v 1.240 2013/02/09 01:20:08 christos Exp $");
 
 #include "opt_defcorename.h"
 #include "ksyms.h"
@@ -2170,8 +2170,10 @@
        namelen = 0;
        ni = 0;
        do {
-               if (ni == CTL_MAXNAME)
+               if (ni == CTL_MAXNAME) {
+                       va_end(ap);
                        return (ENAMETOOLONG);
+               }
                name[ni] = va_arg(ap, int);
        } while (name[ni++] != CTL_EOL);
        namelen = ni - 1;



Home | Main Index | Thread Index | Old Index