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
0ae8386452
commit
8140511319
@ -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