Author: pfg
Date: Mon Apr 20 16:40:13 2015
New Revision: 281770
URL: https://svnweb.freebsd.org/changeset/base/281770

Log:
  Prevent a double free.
  
  This is similar to r281756 so set the ptr NULL after free as a safety belt
  against future changes.
  
  Obtained from:        HardenedBSD (b2e77ced9ae213d358b44d98f552d9ae4636ecac)
  Submitted by: Oliver Pinter
  Revewed by:   rmacklem

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

Modified: head/sys/fs/nfsclient/nfs_clrpcops.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clrpcops.c        Mon Apr 20 16:31:27 2015        
(r281769)
+++ head/sys/fs/nfsclient/nfs_clrpcops.c        Mon Apr 20 16:40:13 2015        
(r281770)
@@ -537,8 +537,10 @@ nfsrpc_openrpc(struct nfsmount *nmp, vno
                            (void) nfs_catnap(PZERO, ret, "nfs_open2");
                    } while (ret == NFSERR_DELAY);
                    if (ret) {
-                       if (ndp != NULL)
+                       if (ndp != NULL) {
                                FREE((caddr_t)ndp, M_NFSCLDELEG);
+                               ndp = NULL;
+                       }
                        if (ret == NFSERR_STALECLIENTID ||
                            ret == NFSERR_STALEDONTRECOVER ||
                            ret == NFSERR_BADSESSION)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to