Date: Wed, 9 Dec 2015 01:24:35 +0000 (UTC) From: Garrett Cooper <ngie@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292005 - head/sbin/swapon Message-ID: <201512090124.tB91OZSU048827@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Wed Dec 9 01:24:34 2015 New Revision: 292005 URL: https://svnweb.freebsd.org/changeset/base/292005 Log: 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 Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Tue Dec 8 22:47:54 2015 (r292004) +++ head/sbin/swapon/swapon.c Wed Dec 9 01:24:34 2015 (r292005) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512090124.tB91OZSU048827>