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);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to