summaryrefslogtreecommitdiff
path: root/sys/arch/macppc/stand
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-09-05 22:32:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-09-05 22:32:47 +0000
commit772191eebf6a62b3fe9de2482c910de8c79000d5 (patch)
treeeea109f48afccf4e7cab1ea695e65fec36d1cf5e /sys/arch/macppc/stand
parenta30f0def118756a387cba2c5eac41a702277da77 (diff)
make sure that va_start() has matching va_end()
Diffstat (limited to 'sys/arch/macppc/stand')
-rw-r--r--sys/arch/macppc/stand/Locore.c10
1 files changed, 7 insertions, 3 deletions
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);