From owner-svn-src-stable@freebsd.org Wed Dec 16 02:43:36 2015 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C0CDA498E0; Wed, 16 Dec 2015 02:43:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09D1F18A3; Wed, 16 Dec 2015 02:43:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBG2hZ5G011934; Wed, 16 Dec 2015 02:43:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBG2hZ79011933; Wed, 16 Dec 2015 02:43:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512160243.tBG2hZ79011933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 16 Dec 2015 02:43:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292311 - stable/10/sbin/swapon X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2015 02:43:36 -0000 Author: ngie Date: Wed Dec 16 02:43:34 2015 New Revision: 292311 URL: https://svnweb.freebsd.org/changeset/base/292311 Log: 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 Modified: stable/10/sbin/swapon/swapon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/swapon/swapon.c ============================================================================== --- stable/10/sbin/swapon/swapon.c Wed Dec 16 01:05:50 2015 (r292310) +++ stable/10/sbin/swapon/swapon.c Wed Dec 16 02:43:34 2015 (r292311) @@ -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);