Date: Mon, 31 Aug 2009 09:50:08 GMT From: Patroklos Argyroudis <argp@census-labs.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/138376: Memory leak in scsi_low_attach_xs() in file sys/cam/scsi/scsi_low.c Message-ID: <200908310950.n7V9o8RO040164@www.freebsd.org> Resent-Message-ID: <200908311000.n7VA0FGb098443@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 138376 >Category: kern >Synopsis: Memory leak in scsi_low_attach_xs() in file sys/cam/scsi/scsi_low.c >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 31 10:00:15 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Patroklos Argyroudis >Release: 8.0-CURRENT >Organization: census, inc >Environment: N/A >Description: Memory leak of pointer sap if the allocation in line 639 fails. >How-To-Repeat: N/A >Fix: Patch attached. Patch attached with submission follows: --- ./sys/cam/scsi/scsi_low.c.orig 2009-08-27 16:57:59.000000000 +0300 +++ ./sys/cam/scsi/scsi_low.c 2009-08-27 17:02:12.000000000 +0300 @@ -638,7 +638,10 @@ 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)); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908310950.n7V9o8RO040164>