aboutsummaryrefslogtreecommitdiff
path: root/lib/libstand
diff options
context:
space:
mode:
authorPaul Saab <ps@FreeBSD.org>2000-05-01 10:53:21 +0000
committerPaul Saab <ps@FreeBSD.org>2000-05-01 10:53:21 +0000
commitf12d45d9d681163821058c1cbbb1a3d40525bf58 (patch)
tree24c1d7b928465402e66f052cdc765afeb7251b38 /lib/libstand
parent89fad7112d0e9719b6b04b4c3e36eb0dd96c37eb (diff)
downloadsrc-f12d45d9d681163821058c1cbbb1a3d40525bf58.tar.gz
src-f12d45d9d681163821058c1cbbb1a3d40525bf58.zip
Do not attempt to free a nfs node if it is the root node. The root
node is statically allocated and is not guarded, so free will panic in nfs_close.
Notes
Notes: svn path=/head/; revision=59824
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/nfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libstand/nfs.c b/lib/libstand/nfs.c
index 1206bb75d8f9..5669973c9bda 100644
--- a/lib/libstand/nfs.c
+++ b/lib/libstand/nfs.c
@@ -109,6 +109,8 @@ static int nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid)
static off_t nfs_seek(struct open_file *f, off_t offset, int where);
static int nfs_stat(struct open_file *f, struct stat *sb);
+static struct nfs_iodesc nfs_root_node;
+
struct fs_ops nfs_fsops = {
"nfs",
nfs_open,
@@ -363,7 +365,6 @@ nfs_open(upath, f)
const char *upath;
struct open_file *f;
{
- static struct nfs_iodesc nfs_root_node;
struct iodesc *desc;
struct nfs_iodesc *currfd;
#ifndef NFS_NOSYMLINK
@@ -546,7 +547,7 @@ nfs_close(f)
printf("nfs_close: fp=0x%lx\n", (u_long)fp);
#endif
- if (fp)
+ if (fp != &nfs_root_node && fp)
free(fp);
f->f_fsdata = (void *)0;