Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 2015 02:43:35 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
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
Message-ID:  <201512160243.tBG2hZ79011933@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201512160243.tBG2hZ79011933>