From 544c5e5b533574625e9921209ee3ceb1ee3d22d0 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Tue, 29 May 2012 01:48:06 +0000 Subject: Make sure that each va_start has one and only one matching va_end, especially in error cases. --- usr.bin/chat/chat.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'usr.bin/chat') diff --git a/usr.bin/chat/chat.c b/usr.bin/chat/chat.c index 056af3749f9d..86e6cfb3237f 100644 --- a/usr.bin/chat/chat.c +++ b/usr.bin/chat/chat.c @@ -408,6 +408,7 @@ chat_logf(const char *fmt, ...) va_start(args, fmt); vfmtmsg(line, sizeof(line), fmt, args); + va_end(args); if (to_log) syslog(LOG_INFO, "%s", line); if (to_stderr) @@ -425,6 +426,7 @@ fatal(int code, const char *fmt, ...) va_start(args, fmt); vfmtmsg(line, sizeof(line), fmt, args); + va_end(args); if (to_log) syslog(LOG_ERR, "%s", line); if (to_stderr) -- cgit v1.2.3