summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-04-20 16:40:13 +0000
committerpfg <pfg@FreeBSD.org>2015-04-20 16:40:13 +0000
commit2c313e6688983a83279ed1b7fc490299bb591a85 (patch)
treeaeeaf88a237291d5d4d6d18263620892d97d8494 /sys/fs
parenta9137e11b6252da2f9901ebd51b7a3f8e7bbc515 (diff)
downloadFreeBSD-src-2c313e6688983a83279ed1b7fc490299bb591a85.zip
FreeBSD-src-2c313e6688983a83279ed1b7fc490299bb591a85.tar.gz
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
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nfsclient/nfs_clrpcops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/fs/nfsclient/nfs_clrpcops.c b/sys/fs/nfsclient/nfs_clrpcops.c
index 8a83802..7968353 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -537,8 +537,10 @@ nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen,
(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)
OpenPOWER on IntegriCloud