Initialize tvc in afs_remove so that we don't call afs_PutVCache
authorNickolai Zeldovich <kolya@mit.edu>
Sun, 24 Mar 2002 19:08:45 +0000 (19:08 +0000)
committerNickolai Zeldovich <kolya@mit.edu>
Sun, 24 Mar 2002 19:08:45 +0000 (19:08 +0000)
on stack garbage in case of some failure.

src/afs/VNOPS/afs_vnop_remove.c

index 8886da3..f946b3d 100644 (file)
@@ -237,6 +237,10 @@ afs_remove(OSI_VC_ARG(adp), aname, acred)
     afs_Trace2(afs_iclSetp, CM_TRACE_REMOVE, ICL_TYPE_POINTER, adp,
               ICL_TYPE_STRING, aname);
 
+#ifdef AFS_OSF_ENV
+    tvc = (struct vcache *)ndp->ni_vp;  /* should never be null */
+#endif
+
     /* Check if this is dynroot */
     if (afs_IsDynroot(adp)) {
 #ifdef  AFS_OSF_ENV