cppcheck: fix va_end() functions

This commit is contained in:
Pavel Tvrdík 2016-03-29 10:37:31 +02:00 committed by Pavel Tvrdik
parent 122deb6d5b
commit 8f01879c56
3 changed files with 5 additions and 0 deletions

View file

@ -40,6 +40,7 @@ bug(const char *msg, ...)
fputs("Internal error: ", stderr); fputs("Internal error: ", stderr);
vlog(msg, args); vlog(msg, args);
vfprintf(stderr, msg, args); vfprintf(stderr, msg, args);
va_end(args);
exit(1); exit(1);
} }
@ -51,5 +52,6 @@ die(const char *msg, ...)
va_start(args, msg); va_start(args, msg);
cleanup(); cleanup();
vlog(msg, args); vlog(msg, args);
va_end(args);
exit(1); exit(1);
} }

View file

@ -512,6 +512,7 @@ cf_error(char *msg, ...)
va_start(args, msg); va_start(args, msg);
if (bvsnprintf(buf, sizeof(buf), msg, args) < 0) if (bvsnprintf(buf, sizeof(buf), msg, args) < 0)
strcpy(buf, "<bug: error message too long>"); strcpy(buf, "<bug: error message too long>");
va_end(args);
new_config->err_msg = cfg_strdup(buf); new_config->err_msg = cfg_strdup(buf);
new_config->err_lino = ifs->lino; new_config->err_lino = ifs->lino;
new_config->err_file_name = ifs->file_name; new_config->err_file_name = ifs->file_name;

View file

@ -209,6 +209,7 @@ bug(const char *msg, ...)
va_start(args, msg); va_start(args, msg);
vlog(L_BUG[0], msg, args); vlog(L_BUG[0], msg, args);
va_end(args);
abort(); abort();
} }
@ -226,6 +227,7 @@ die(const char *msg, ...)
va_start(args, msg); va_start(args, msg);
vlog(L_FATAL[0], msg, args); vlog(L_FATAL[0], msg, args);
va_end(args);
exit(1); exit(1);
} }