svn commit: r299490 - head/sbin/camcontrol

Conrad E. Meyer cem at FreeBSD.org
Wed May 11 22:25:16 UTC 2016


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);
 }


More information about the svn-src-head mailing list