Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Sep 2014 06:29:32 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271353 - head/sys/cam/ctl
Message-ID:  <201409100629.s8A6TWlf054217@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Sep 10 06:29:31 2014
New Revision: 271353
URL: http://svnweb.freebsd.org/changeset/base/271353

Log:
  Fix memory leak on error, reported by Coverity.
  
  CID:		1007773

Modified:
  head/sys/cam/ctl/ctl.c

Modified: head/sys/cam/ctl/ctl.c
==============================================================================
--- head/sys/cam/ctl/ctl.c	Wed Sep 10 06:25:18 2014	(r271352)
+++ head/sys/cam/ctl/ctl.c	Wed Sep 10 06:29:31 2014	(r271353)
@@ -2899,6 +2899,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, 
 		lun = softc->ctl_luns[err_desc->lun_id];
 		if (lun == NULL) {
 			mtx_unlock(&softc->ctl_lock);
+			free(new_err_desc, M_CTL);
 			printf("%s: CTL_ERROR_INJECT: invalid LUN %ju\n",
 			       __func__, (uintmax_t)err_desc->lun_id);
 			retval = EINVAL;



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