Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Apr 2015 23:55:59 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r281756 - head/sys/fs/nfsclient
Message-ID:  <201504192355.t3JNtx0i079921@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun Apr 19 23:55:59 2015
New Revision: 281756
URL: https://svnweb.freebsd.org/changeset/base/281756

Log:
  nfsrpc_createv4: fix double free.
  
  Reported by:	Oliver Pinter, clang static checker
  Obtained from:	HardenedBSD (commit 63cac77c42c0c3fc67da62f97d5ab651d52ae707)
  Reviewed by:	rmacklem
  MFC after:	5 days

Modified:
  head/sys/fs/nfsclient/nfs_clrpcops.c

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clrpcops.c	Sun Apr 19 23:45:04 2015	(r281755)
+++ head/sys/fs/nfsclient/nfs_clrpcops.c	Sun Apr 19 23:55:59 2015	(r281756)
@@ -2153,8 +2153,10 @@ nfsrpc_createv4(vnode_t dvp, char *name,
 			    (void) nfs_catnap(PZERO, ret, "nfs_crt2");
 		    } while (ret == NFSERR_DELAY);
 		    if (ret) {
-			if (dp != NULL)
+			if (dp != NULL) {
 				FREE((caddr_t)dp, M_NFSCLDELEG);
+				dp = NULL;
+			}
 			if (ret == NFSERR_STALECLIENTID ||
 			    ret == NFSERR_STALEDONTRECOVER ||
 			    ret == NFSERR_BADSESSION)



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