summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-09 01:24:34 +0000
committerngie <ngie@FreeBSD.org>2015-12-09 01:24:34 +0000
commit81405113199dc2ec33e9cd60464efa5f2423a65c (patch)
treee1a0733fd35b438b5cb90e70c50a6b7503ffba42 /sbin
parent0ae838645225acf41ea8568ba66d9a9328609b61 (diff)
downloadFreeBSD-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
Diffstat (limited to 'sbin')
-rw-r--r--sbin/swapon/swapon.c1
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);
OpenPOWER on IntegriCloud