[NPFS]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 1 Jun 2010 10:57:26 +0000 (10:57 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 1 Jun 2010 10:57:26 +0000 (10:57 +0000)
- Fix 2 memory leaks when creating a pipe fails
- Fix minor style issue

svn path=/trunk/; revision=47513

reactos/drivers/filesystems/npfs/create.c
reactos/drivers/filesystems/npfs/rw.c

index 2eb0aad..bef462f 100644 (file)
@@ -255,8 +255,9 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
                 if (ClientCcb->Data)
                 {
                     ExFreePool(ClientCcb->Data);
-                    ClientCcb->Data = NULL;
                 }
+
+                ExFreePool(ClientCcb);
                 KeUnlockMutex(&Fcb->CcbListLock);
                 Irp->IoStatus.Status = STATUS_OBJECT_PATH_NOT_FOUND;
                 IoCompleteRequest(Irp, IO_NO_INCREMENT);
@@ -273,6 +274,14 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
     else if (IsListEmpty(&Fcb->ServerCcbListHead))
     {
         DPRINT("No server fcb found!\n");
+
+        if (ClientCcb->Data)
+        {
+            ExFreePool(ClientCcb->Data);
+        }
+
+        ExFreePool(ClientCcb);
+
         KeUnlockMutex(&Fcb->CcbListLock);
         Irp->IoStatus.Status = STATUS_UNSUCCESSFUL;
         IoCompleteRequest(Irp, IO_NO_INCREMENT);
index 5a03977..e5ef963 100644 (file)
@@ -163,7 +163,7 @@ NpfsWaiterThread(PVOID InitContext)
             ASSERT(FALSE);
         }
         KeLockMutex(&ThreadContext->DeviceExt->PipeListLock);
-        Count = Status - STATUS_SUCCESS;
+        Count = Status - STATUS_WAIT_0;
         ASSERT (Count < CurrentCount);
         if (Count > 0)
         {