1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-30 10:50:15 +03:00

shared: call va_end in all cases

This commit is contained in:
Lukas Nykryn 2012-09-21 10:22:46 +02:00 committed by Lennart Poettering
parent 409133be63
commit e98055de98
2 changed files with 4 additions and 2 deletions

View File

@ -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);

View File

@ -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;
}