diff options
author | ngie <ngie@FreeBSD.org> | 2015-12-16 02:43:34 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2015-12-16 02:43:34 +0000 |
commit | 510ad3acccc7699c09ea5862ad152836c6e0216b (patch) | |
tree | 97e332d834d3f50e139ecd77013219f8c7a797c4 /sbin | |
parent | 1c8d079e365804e832c0f207b39d430d249309f3 (diff) | |
download | FreeBSD-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.c | 1 |
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); |