Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Oct 2009 06:13:07 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198356 - head/sys/cam/scsi
Message-ID:  <200910220613.n9M6D7LK020884@svn.freebsd.org>

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



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