From: Pavel TvrdĂ­k Date: Tue, 29 Mar 2016 08:37:31 +0000 (+0200) Subject: cppcheck: fix va_end() functions X-Git-Tag: v1.6.1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f01879c5629bd714dfeec968337cfcd4dbe6a87;p=thirdparty%2Fbird.git cppcheck: fix va_end() functions --- diff --git a/client/util.c b/client/util.c index c35cf8f43..2d6c074d6 100644 --- a/client/util.c +++ b/client/util.c @@ -40,6 +40,7 @@ bug(const char *msg, ...) fputs("Internal error: ", stderr); vlog(msg, args); vfprintf(stderr, msg, args); + va_end(args); exit(1); } @@ -51,5 +52,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 825a8e9f1..efaeedeb9 100644 --- a/conf/conf.c +++ b/conf/conf.c @@ -512,6 +512,7 @@ cf_error(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 6665d035b..631bd6916 100644 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@ -209,6 +209,7 @@ bug(const char *msg, ...) va_start(args, msg); vlog(L_BUG[0], msg, args); + va_end(args); abort(); } @@ -226,6 +227,7 @@ die(const char *msg, ...) va_start(args, msg); vlog(L_FATAL[0], msg, args); + va_end(args); exit(1); }