summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Moellers <jmoellers@suse.de>2019-01-25 16:29:07 +0100
committerTomáš Mráz <t8m@users.noreply.github.com>2020-01-15 18:16:53 +0100
commit338189fddbb7a5deabf8eb3b82d7e40b65c733a6 (patch)
tree1991d6984f6cff071a91dacc57d071afa63db03f
parentaea5d57019696554a1235fad872e6abec1fe1369 (diff)
Add two missing va_end() calls
According to the man pages, "Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function."
-rw-r--r--modules/pam_rootok/pam_rootok.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/pam_rootok/pam_rootok.c b/modules/pam_rootok/pam_rootok.c
index 80a67f6d..accba21a 100644
--- a/modules/pam_rootok/pam_rootok.c
+++ b/modules/pam_rootok/pam_rootok.c
@@ -73,12 +73,15 @@ log_callback (int type UNUSED, const char *fmt, ...)
if (audit_fd >= 0) {
char *buf;
- if (vasprintf (&buf, fmt, ap) < 0)
+ if (vasprintf (&buf, fmt, ap) < 0) {
+ va_end(ap);
return 0;
+ }
audit_log_user_avc_message(audit_fd, AUDIT_USER_AVC, buf, NULL, NULL,
NULL, 0);
audit_close(audit_fd);
free(buf);
+ va_end(ap);
return 0;
}