Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 May 2016 22:25:14 +0000 (UTC)
From:      "Conrad E. Meyer" <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r299490 - head/sbin/camcontrol
Message-ID:  <201605112225.u4BMPEMg041731@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Wed May 11 22:25:14 2016
New Revision: 299490
URL: https://svnweb.freebsd.org/changeset/base/299490

Log:
  camcontrol(8): Fix another trivial double-free
  
  Reported by:	Coverity
  CID:		1331222
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sbin/camcontrol/fwdownload.c

Modified: head/sbin/camcontrol/fwdownload.c
==============================================================================
--- head/sbin/camcontrol/fwdownload.c	Wed May 11 22:22:49 2016	(r299489)
+++ head/sbin/camcontrol/fwdownload.c	Wed May 11 22:25:14 2016	(r299490)
@@ -488,6 +488,7 @@ fw_validate_ibm(struct cam_device *dev, 
 				CAM_EPF_ALL, stderr);
 
 		cam_freeccb(ccb);
+		ccb = NULL;
 		goto bailout;
 	}
 
@@ -549,7 +550,8 @@ fw_validate_ibm(struct cam_device *dev, 
 		fprintf(stdout, "Firmware file is valid for this drive.\n");
 	retval = 0;
 bailout:
-	cam_freeccb(ccb);
+	if (ccb != NULL)
+		cam_freeccb(ccb);
 
 	return (retval);
 }



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