diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index ed9f5685b6bc..f58143179c2f 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);