Call va_end on ap when vsnprintf fails in run_cmd(..) to clean up

the variable state

MFC after: 1 week
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
Enji Cooper 2015-12-09 01:24:34 +00:00
parent 692a3987f2
commit 33c2e470b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=292005

View File

@ -642,6 +642,7 @@ run_cmd(int *ofd, const char *cmdline, ...)
rv = vasprintf(&cmd, cmdline, ap);
if (rv == -1) {
warn("%s", __func__);
va_end(ap);
return (rv);
}
va_end(ap);