summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-12-16 02:43:34 +0000
committerngie <ngie@FreeBSD.org>2015-12-16 02:43:34 +0000
commit510ad3acccc7699c09ea5862ad152836c6e0216b (patch)
tree97e332d834d3f50e139ecd77013219f8c7a797c4 /sbin
parent1c8d079e365804e832c0f207b39d430d249309f3 (diff)
downloadFreeBSD-src-510ad3acccc7699c09ea5862ad152836c6e0216b.zip
FreeBSD-src-510ad3acccc7699c09ea5862ad152836c6e0216b.tar.gz
MFC r292005:
Call va_end on ap when vsnprintf fails in run_cmd(..) to clean up the variable state 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 033c40a..6351053 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -640,6 +640,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