Don't set sillyrename field to 0 for directories, as it's in a union with
authorderaadt <deraadt@openbsd.org>
Fri, 18 Apr 1997 10:09:46 +0000 (10:09 +0000)
committerderaadt <deraadt@openbsd.org>
Fri, 18 Apr 1997 10:09:46 +0000 (10:09 +0000)
the head of the cookie list. Fixes PR 3215, fix supplied by Hiroshi Tezuka
<tezuka@trc.rwcp.or.jp>. Should also fix M_NFSDIROFF memory leak; fvdl

sys/nfs/nfs_node.c

index 8680605..27c5518 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: nfs_node.c,v 1.6 1996/04/21 22:30:19 deraadt Exp $    */
+/*     $OpenBSD: nfs_node.c,v 1.7 1997/04/18 10:09:46 deraadt Exp $    */
 /*     $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $       */
 
 /*
@@ -174,11 +174,11 @@ nfs_inactive(v)
        np = VTONFS(ap->a_vp);
        if (prtactive && ap->a_vp->v_usecount != 0)
                vprint("nfs_inactive: pushing active", ap->a_vp);
-       if (ap->a_vp->v_type != VDIR)
+       if (ap->a_vp->v_type != VDIR) {
                sp = np->n_sillyrename;
-       else
+               np->n_sillyrename = (struct sillyrename *)0;
+       } else
                sp = (struct sillyrename *)0;
-       np->n_sillyrename = (struct sillyrename *)0;
        if (sp) {
                /*
                 * Remove the silly file that was rename'd earlier