svn commit: r198356 - head/sys/cam/scsi

Christian Brueffer brueffer at FreeBSD.org
Thu Oct 22 06:13:08 UTC 2009


Author: brueffer
Date: Thu Oct 22 06:13:07 2009
New Revision: 198356
URL: http://svn.freebsd.org/changeset/base/198356

Log:
  Fix a memory leak in an error case.
  
  PR:		138376
  Submitted by:	Patroklos Argyroudis <argp at census-labs.com>
  Reviewed by:	scottl
  MFC after:	1 week

Modified:
  head/sys/cam/scsi/scsi_low.c

Modified: head/sys/cam/scsi/scsi_low.c
==============================================================================
--- head/sys/cam/scsi/scsi_low.c	Thu Oct 22 04:35:32 2009	(r198355)
+++ head/sys/cam/scsi/scsi_low.c	Thu Oct 22 06:13:07 2009	(r198356)
@@ -638,7 +638,10 @@ scsi_low_attach_xs(slp)
 		return ENOMEM;
 	splp = SCSI_LOW_MALLOC(sizeof(*splp));
 	if (splp == NULL)
+	{
+		SCSI_LOW_FREE(sap);
 		return ENOMEM;
+	}
 
 	SCSI_LOW_BZERO(sap, sizeof(*sap));
 	SCSI_LOW_BZERO(splp, sizeof(*splp));


More information about the svn-src-all mailing list