Sync with trunk (r48545)
[reactos.git] / dll / win32 / kernel32 / file / npipe.c
index d62527e..3896e9b 100644 (file)
@@ -10,9 +10,9 @@
 /* INCLUDES *****************************************************************/
 
 #include <k32.h>
-#include <wine/debug.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(kernel32file);
+#define NDEBUG
+#include <debug.h>
+static ULONG gDebugChannel = kernel32file;
 
 //#define USING_PROPER_NPFS_WAIT_SEMANTICS
 
@@ -496,6 +496,7 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);
+        RtlFreeUnicodeString(&NamedPipeName);
         return FALSE;
     }
 
@@ -538,9 +539,11 @@ WaitNamedPipeW(LPCWSTR lpNamedPipeName,
     if (!NT_SUCCESS(Status))
     {
         SetLastErrorByStatus(Status);
+        RtlFreeUnicodeString(&NamedPipeName);
         return FALSE;
     }
 
+    RtlFreeUnicodeString(&NamedPipeName);
     return TRUE;
 }
 #endif