summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ntpd
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2019-07-03 05:04:19 +0000
committerotto <otto@openbsd.org>2019-07-03 05:04:19 +0000
commit1454e1a7fcf2b3031ecb2cd12a1df149d777069a (patch)
treec0c0078c231cae676ab8ec3c1204cc788a347cda /usr.sbin/ntpd
parentsnprintf/vsnprintf return < 0 on error, rather than -1. (diff)
downloadwireguard-openbsd-1454e1a7fcf2b3031ecb2cd12a1df149d777069a.tar.xz
wireguard-openbsd-1454e1a7fcf2b3031ecb2cd12a1df149d777069a.zip
Forgotten va_copy/va_end; on some archs that is really needed. ok benno@
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r--usr.sbin/ntpd/log.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/log.c b/usr.sbin/ntpd/log.c
index 4022d0f827f..56fd38c0985 100644
--- a/usr.sbin/ntpd/log.c
+++ b/usr.sbin/ntpd/log.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: log.c,v 1.18 2019/06/27 15:18:42 otto Exp $ */
+/* $OpenBSD: log.c,v 1.19 2019/07/03 05:04:19 otto Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -78,7 +78,9 @@ vlog(int pri, const char *fmt, va_list ap)
{
char *nfmt;
int saved_errno = errno;
+ va_list ap2;
+ va_copy(ap2, ap);
if (dest & LOG_TO_STDERR) {
/* best effort in out of mem situations */
if (asprintf(&nfmt, "%s\n", fmt) == -1) {
@@ -91,7 +93,8 @@ vlog(int pri, const char *fmt, va_list ap)
fflush(stderr);
}
if (dest & LOG_TO_SYSLOG)
- vsyslog(pri, fmt, ap);
+ vsyslog(pri, fmt, ap2);
+ va_end(ap2);
errno = saved_errno;
}