From 338189fddbb7a5deabf8eb3b82d7e40b65c733a6 Mon Sep 17 00:00:00 2001 From: Josef Moellers Date: Fri, 25 Jan 2019 16:29:07 +0100 Subject: 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." --- modules/pam_rootok/pam_rootok.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3