summaryrefslogtreecommitdiff
path: root/usr.bin/chat
diff options
context:
space:
mode:
authorKevin Lo <kevlo@FreeBSD.org>2012-05-29 01:48:06 +0000
committerKevin Lo <kevlo@FreeBSD.org>2012-05-29 01:48:06 +0000
commit544c5e5b533574625e9921209ee3ceb1ee3d22d0 (patch)
treeab9b314dc9e2edd5a771820aeac2cbe20228150c /usr.bin/chat
parentbebda077b136c9c051f070dc6ad0704f85025322 (diff)
downloadsrc-test2-544c5e5b533574625e9921209ee3ceb1ee3d22d0.tar.gz
src-test2-544c5e5b533574625e9921209ee3ceb1ee3d22d0.zip
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
Notes
Notes: svn path=/head/; revision=236213
Diffstat (limited to 'usr.bin/chat')
-rw-r--r--usr.bin/chat/chat.c2
1 files changed, 2 insertions, 0 deletions
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)