diff options
author | Mike Pechkin <mpech@cvs.openbsd.org> | 2001-11-29 18:21:24 +0000 |
---|---|---|
committer | Mike Pechkin <mpech@cvs.openbsd.org> | 2001-11-29 18:21:24 +0000 |
commit | 3120168c342c39a169b8654f2e52e3ad13ea473a (patch) | |
tree | 475f89a4c1e1d1a5b67091c9c369c9fdd456c1f9 | |
parent | d7fd0df3362bfa21486f24f930ca8d95dd4cc2a7 (diff) |
make sure that va_start() has matching va_end()
millert@ help&ok
-rw-r--r-- | usr.bin/pr/pr.c | 5 | ||||
-rw-r--r-- | usr.bin/sup/src/supmsg.c | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/usr.bin/pr/pr.c b/usr.bin/pr/pr.c index 9dcb580f320..bdcaf219d91 100644 --- a/usr.bin/pr/pr.c +++ b/usr.bin/pr/pr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pr.c,v 1.13 2001/11/19 19:02:15 mpech Exp $ */ +/* $OpenBSD: pr.c,v 1.14 2001/11/29 18:21:23 mpech Exp $ */ /*- * Copyright (c) 1991 Keith Muller. @@ -45,7 +45,7 @@ static char copyright[] = #ifndef lint /* from: static char sccsid[] = "@(#)pr.c 8.1 (Berkeley) 6/6/93"; */ -static char *rcsid = "$OpenBSD: pr.c,v 1.13 2001/11/19 19:02:15 mpech Exp $"; +static char *rcsid = "$OpenBSD: pr.c,v 1.14 2001/11/29 18:21:23 mpech Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -872,6 +872,7 @@ ferrout(char *fmt, ...) ferrtail = f; sigprocmask(SIG_SETMASK, &oblock, NULL); } + va_end(ap); } /* diff --git a/usr.bin/sup/src/supmsg.c b/usr.bin/sup/src/supmsg.c index 51d9ee37be3..edd636184c8 100644 --- a/usr.bin/sup/src/supmsg.c +++ b/usr.bin/sup/src/supmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: supmsg.c,v 1.7 2001/05/04 22:16:17 millert Exp $ */ +/* $OpenBSD: supmsg.c,v 1.8 2001/11/29 18:21:23 mpech Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -599,7 +599,7 @@ va_dcl x = writestring(NULL); if (x == SCMOK) x = writemend(); - return (x); + goto done; } if (x == SCMOK) x = writestring(t->Tname); @@ -608,7 +608,7 @@ va_dcl if (t->Tmode == 0) { if (x == SCMOK) x = writemend(); - return (x); + goto done; } if (x == SCMOK) x = writeint(t->Tflags); @@ -633,8 +633,10 @@ va_dcl } else { char *linkname, *execcmd; - if (t == NULL) - return (SCMERR); + if (t == NULL) { + x = SCMERR; + goto done; + } x = readmsg (MSGRECV); if (x == SCMOK) x = readstring(&t->Tname); @@ -642,7 +644,7 @@ va_dcl x = readmend(); if (x == SCMOK) x = (*xferfile)(NULL, args); - return (x); + goto done; } if (x == SCMOK) x = readint(&t->Tmode); @@ -650,7 +652,7 @@ va_dcl x = readmend(); if (x == SCMOK) x = (*xferfile)(t, args); - return (x); + goto done; } if (x == SCMOK) x = readint(&t->Tflags); @@ -685,6 +687,8 @@ va_dcl if (x == SCMOK) x = readmend(); } + +done: va_end(args); return (x); } |