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:
parent
692a3987f2
commit
33c2e470b4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user