createx-null-ptr-20050126
authorJeffrey Altman <jaltman@mit.edu>
Thu, 27 Jan 2005 00:09:32 +0000 (00:09 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 27 Jan 2005 00:09:32 +0000 (00:09 +0000)
Don't release null scps

src/WINNT/afsd/smb3.c

index f8b221a..73844a4 100644 (file)
@@ -5245,8 +5245,8 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
         /* don't create if not found */
         if (dscp)
             cm_ReleaseSCache(dscp);
-               if (scp)
-                       cm_ReleaseSCache(scp);
+        if (scp)
+            cm_ReleaseSCache(scp);
         cm_ReleaseUser(userp);
         free(realPathp);
         return CM_ERROR_NOSUCHFILE;
@@ -5365,9 +5365,11 @@ long smb_ReceiveNTCreateX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
             }
         }
 
-        cm_ReleaseSCache(dscp);
+        if (dscp)
+            cm_ReleaseSCache(dscp);
         dscp = tscp1;
-        cm_ReleaseSCache(scp);
+        if (scp)
+            cm_ReleaseSCache(scp);
         scp = tscp2;
         /* 
          * if we get here and code == 0, then scp is the last directory created, and dscp is the