summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2012-09-21 10:22:46 +0200
committerLennart Poettering <lennart@poettering.net>2012-09-21 12:07:41 +0200
commite98055de981b568c31f18f470181ae166b56f172 (patch)
tree1951f7fcf4f17a7083e1cd4f327d3f78225af254
parent409133be63387fc04d927e8aecd2f6ba03d2f143 (diff)
shared: call va_end in all cases
-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;
}