diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-09-05 22:32:47 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-09-05 22:32:47 +0000 |
commit | 772191eebf6a62b3fe9de2482c910de8c79000d5 (patch) | |
tree | eea109f48afccf4e7cab1ea695e65fec36d1cf5e /sys/arch | |
parent | a30f0def118756a387cba2c5eac41a702277da77 (diff) |
make sure that va_start() has matching va_end()
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/amiga/stand/device-streams/util.c | 8 | ||||
-rw-r--r-- | sys/arch/macppc/macppc/opendev.c | 18 | ||||
-rw-r--r-- | sys/arch/macppc/stand/Locore.c | 10 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/openfirm.c | 18 |
4 files changed, 40 insertions, 14 deletions
diff --git a/sys/arch/amiga/stand/device-streams/util.c b/sys/arch/amiga/stand/device-streams/util.c index 360ece26752..3275be828cd 100644 --- a/sys/arch/amiga/stand/device-streams/util.c +++ b/sys/arch/amiga/stand/device-streams/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.2 2001/07/04 08:44:59 niklas Exp $ */ +/* $OpenBSD: util.c,v 1.3 2001/09/05 22:32:38 deraadt Exp $ */ /* -------------------------------------------------- | NAME @@ -236,6 +236,7 @@ ask_bool (int def, int other, char *f, ...) va_start (ap, f); vfprintf (mout, f, ap); fprintf (mout, "? [%lc%lc]:",toupper (def),tolower (other)); + va_end (ap); fflush (mout); if (fgets (buffer, 18, min)) { char *s = stripws (buffer); @@ -287,6 +288,7 @@ verbose_message (char *f, ...) va_start (ap, f); vfprintf (mout, f, ap); fprintf (mout, "\n"); + va_end (ap); } } @@ -299,6 +301,7 @@ debug_message (char *f, ...) fprintf (mout, "debug: "); vfprintf (mout, f, ap); fprintf (mout, "\n"); + va_end (ap); } } @@ -311,6 +314,7 @@ verbose_debug_message (char *f, ...) fprintf (mout, "debug: "); vfprintf (mout, f, ap); fprintf (mout, "\n"); + va_end (ap); } } @@ -321,6 +325,7 @@ message (char *f, ...) va_start (ap, f); vfprintf (mout, f, ap); fprintf (mout, "\n"); + va_end (ap); } void @@ -331,6 +336,7 @@ warn_message (char *f, ...) fprintf (mout, "warn: "); vfprintf (mout, f, ap); fprintf (mout, "\n"); + va_end (ap); } void diff --git a/sys/arch/macppc/macppc/opendev.c b/sys/arch/macppc/macppc/opendev.c index c27aad313ef..431d82ed98b 100644 --- a/sys/arch/macppc/macppc/opendev.c +++ b/sys/arch/macppc/macppc/opendev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: opendev.c,v 1.1 2001/09/01 15:44:20 drahn Exp $ */ +/* $OpenBSD: opendev.c,v 1.2 2001/09/05 22:32:38 deraadt Exp $ */ /* $NetBSD: openfirm.c,v 1.1 1996/09/30 16:34:52 ws Exp $ */ /* @@ -136,10 +136,14 @@ OF_call_method(method, ihandle, nargs, nreturns, va_alist) for (ip = args.args_n_results + (n = nargs); --n >= 0;) *--ip = va_arg(ap, int); ofw_stack(); - if (openfirmware(&args) == -1) + if (openfirmware(&args) == -1) { + va_end(ap); return -1; - if (args.args_n_results[nargs]) + } + if (args.args_n_results[nargs]) { + va_end(ap); return args.args_n_results[nargs]; + } for (ip = args.args_n_results + nargs + (n = args.nreturns); --n > 0;) *va_arg(ap, int *) = *--ip; va_end(ap); @@ -181,10 +185,14 @@ OF_call_method_1(method, ihandle, nargs, va_alist) *--ip = va_arg(ap, int); va_end(ap); ofw_stack(); - if (openfirmware(&args) == -1) + if (openfirmware(&args) == -1) { + va_end(ap); return -1; - if (args.args_n_results[nargs]) + } + if (args.args_n_results[nargs]) { + va_end(ap); return -1; + } return args.args_n_results[nargs + 1]; } diff --git a/sys/arch/macppc/stand/Locore.c b/sys/arch/macppc/stand/Locore.c index e43d875d36c..16255a14ffd 100644 --- a/sys/arch/macppc/stand/Locore.c +++ b/sys/arch/macppc/stand/Locore.c @@ -1,4 +1,4 @@ -/* $OpenBSD: Locore.c,v 1.1 2001/09/01 15:39:02 drahn Exp $ */ +/* $OpenBSD: Locore.c,v 1.2 2001/09/05 22:32:39 deraadt Exp $ */ /* $NetBSD: Locore.c,v 1.1 1997/04/16 20:29:11 thorpej Exp $ */ /* @@ -543,10 +543,14 @@ OF_call_method(method, ihandle, nargs, nreturns, va_alist) for (ip = args.args_n_results + (n = nargs); --n >= 0;) *--ip = va_arg(ap, int); - if (openfirmware(&args) == -1) + if (openfirmware(&args) == -1) { + va_end(ap); return -1; - if (args.args_n_results[nargs]) + } + if (args.args_n_results[nargs]) { + va_end(ap); return args.args_n_results[nargs]; + } for (ip = args.args_n_results + nargs + (n = args.nreturns); --n > 0;) *va_arg(ap, int *) = *--ip; va_end(ap); diff --git a/sys/arch/sparc64/sparc64/openfirm.c b/sys/arch/sparc64/sparc64/openfirm.c index 5c8c7603b29..d4a3249732c 100644 --- a/sys/arch/sparc64/sparc64/openfirm.c +++ b/sys/arch/sparc64/sparc64/openfirm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openfirm.c,v 1.3 2001/08/24 00:03:23 art Exp $ */ +/* $OpenBSD: openfirm.c,v 1.4 2001/09/05 22:32:39 deraadt Exp $ */ /* $NetBSD: openfirm.c,v 1.13 2001/06/21 00:08:02 eeh Exp $ */ /* @@ -355,10 +355,14 @@ OF_call_method(method, ihandle, nargs, nreturns, va_alist) va_start(ap, nreturns); for (ip = (long*)(args.args_n_results + (n = nargs)); --n >= 0;) *--ip = va_arg(ap, unsigned long); - if (openfirmware(&args) == -1) + if (openfirmware(&args) == -1) { + va_end(ap); return -1; - if (args.args_n_results[nargs]) + } + if (args.args_n_results[nargs]) { + va_end(ap); return args.args_n_results[nargs]; + } for (ip = (long*)(args.args_n_results + nargs + (n = args.nreturns)); --n > 0;) *va_arg(ap, unsigned long *) = *--ip; va_end(ap); @@ -398,10 +402,14 @@ OF_call_method_1(method, ihandle, nargs, va_alist) for (ip = (long*)(args.args_n_results + (n = nargs)); --n >= 0;) *--ip = va_arg(ap, unsigned long); va_end(ap); - if (openfirmware(&args) == -1) + if (openfirmware(&args) == -1) { + va_end(ap); return -1; - if (args.args_n_results[nargs]) + } + if (args.args_n_results[nargs]) { + va_end(ap); return -1; + } return args.args_n_results[nargs + 1]; } |