diff --git a/client/util.c b/client/util.c index 050224b9..826cd48d 100644 --- a/client/util.c +++ b/client/util.c @@ -37,6 +37,7 @@ bug(const char *msg, ...) fputs("Internal error: ", stderr); vlog(msg, args); vfprintf(stderr, msg, args); + va_end(args); exit(1); } @@ -48,5 +49,6 @@ die(const char *msg, ...) va_start(args, msg); cleanup(); vlog(msg, args); + va_end(args); exit(1); } diff --git a/conf/conf.c b/conf/conf.c index b4474ce6..54a87d12 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -507,6 +507,7 @@ cf_error(const char *msg, ...) va_start(args, msg); if (bvsnprintf(buf, sizeof(buf), msg, args) < 0) strcpy(buf, ""); + va_end(args); new_config->err_msg = cfg_strdup(buf); new_config->err_lino = ifs->lino; new_config->err_file_name = ifs->file_name; diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c index 7cb26360..5cd15156 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -208,6 +208,7 @@ bug(const char *msg, ...) va_start(args, msg); vlog(L_BUG[0], msg, args); + va_end(args); abort(); } @@ -225,6 +226,7 @@ die(const char *msg, ...) va_start(args, msg); vlog(L_FATAL[0], msg, args); + va_end(args); exit(1); }