diff options
author | ngie <ngie@FreeBSD.org> | 2015-12-09 01:24:34 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-12-09 01:24:34 +0000 |
commit | 81405113199dc2ec33e9cd60464efa5f2423a65c (patch) | |
tree | e1a0733fd35b438b5cb90e70c50a6b7503ffba42 | |
parent | 0ae838645225acf41ea8568ba66d9a9328609b61 (diff) | |
download | FreeBSD-src-81405113199dc2ec33e9cd60464efa5f2423a65c.zip FreeBSD-src-81405113199dc2ec33e9cd60464efa5f2423a65c.tar.gz |
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
-rw-r--r-- | sbin/swapon/swapon.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index ed9f568..f581431 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -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); |