summaryrefslogtreecommitdiff
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorJoerg Jung <jung@cvs.openbsd.org>2016-05-22 19:19:22 +0000
committerJoerg Jung <jung@cvs.openbsd.org>2016-05-22 19:19:22 +0000
commit099f11158c9cb650666f7229cd80b616168e0bb2 (patch)
treee021d80bf9dc328bb5ea6b32c8a4d3d61fd94b84 /usr.sbin/httpd
parent0ff5dd25594482aa12eef561d1a643fbfe23084f (diff)
fix unbalanced va_start and va_end macros
from Hiltjo Posthuma "do." deraadt
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r--usr.sbin/httpd/httpd.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/httpd/httpd.c b/usr.sbin/httpd/httpd.c
index 797133d972b..37a2ea8edd6 100644
--- a/usr.sbin/httpd/httpd.c
+++ b/usr.sbin/httpd/httpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: httpd.c,v 1.54 2016/02/02 17:51:11 sthen Exp $ */
+/* $OpenBSD: httpd.c,v 1.55 2016/05/22 19:19:21 jung Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
@@ -1000,11 +1000,13 @@ kv_set(struct kv *kv, char *fmt, ...)
va_list ap;
char *value = NULL;
struct kv *ckv;
+ int ret;
va_start(ap, fmt);
- if (vasprintf(&value, fmt, ap) == -1)
- return (-1);
+ ret = vasprintf(&value, fmt, ap);
va_end(ap);
+ if (ret == -1)
+ return (-1);
/* Remove all children */
while ((ckv = TAILQ_FIRST(&kv->kv_children)) != NULL) {
@@ -1025,11 +1027,13 @@ kv_setkey(struct kv *kv, char *fmt, ...)
{
va_list ap;
char *key = NULL;
+ int ret;
va_start(ap, fmt);
- if (vasprintf(&key, fmt, ap) == -1)
- return (-1);
+ ret = vasprintf(&key, fmt, ap);
va_end(ap);
+ if (ret == -1)
+ return (-1);
free(kv->kv_key);
kv->kv_key = key;