summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2015-04-19 23:55:59 +0000
committerpfg <pfg@FreeBSD.org>2015-04-19 23:55:59 +0000
commit32880107f3a6ed0e57f581ce59818effda961e07 (patch)
treede000fc7a0f3489784aa2e52b92e94f0ee56c132 /sys/fs
parente68569ebeea2990063ae3771f852d1aea9f59848 (diff)
downloadFreeBSD-src-32880107f3a6ed0e57f581ce59818effda961e07.zip
FreeBSD-src-32880107f3a6ed0e57f581ce59818effda961e07.tar.gz
nfsrpc_createv4: fix double free.
Reported by: Oliver Pinter, clang static checker Obtained from: HardenedBSD (commit 63cac77c42c0c3fc67da62f97d5ab651d52ae707) Reviewed by: rmacklem MFC after: 5 days
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 e1bfa29..8a83802 100644
--- a/sys/fs/nfsclient/nfs_clrpcops.c
+++ b/sys/fs/nfsclient/nfs_clrpcops.c
@@ -2153,8 +2153,10 @@ nfsrpc_createv4(vnode_t dvp, char *name, int namelen, struct vattr *vap,
(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)
OpenPOWER on IntegriCloud