summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/log.c2
-rw-r--r--src/shared/util.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/shared/log.c b/src/shared/log.c
index 7b0a9144a2..b61845859f 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -719,7 +719,6 @@ int log_struct_internal(
format = va_arg(ap, char *);
}
- va_end(ap);
zero(mh);
mh.msg_iov = iovec;
@@ -731,6 +730,7 @@ int log_struct_internal(
r = 1;
finish:
+ va_end(ap);
for (i = 1; i < n; i += 2)
free(iovec[i].iov_base);
diff --git a/src/shared/util.c b/src/shared/util.c
index be94515d9d..97f766c33c 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -5024,8 +5024,10 @@ char *strjoin(const char *x, ...) {
break;
n = strlen(t);
- if (n > ((size_t) -1) - l)
+ if (n > ((size_t) -1) - l) {
+ va_end(ap);
return NULL;
+ }
l += n;
}