[KERNEL32] WaitNamedPipeW: Free Unicode buffer when leaving the function
authorGregor Schneider <grschneider@gmail.com>
Sat, 29 May 2010 12:29:26 +0000 (12:29 +0000)
committerGregor Schneider <grschneider@gmail.com>
Sat, 29 May 2010 12:29:26 +0000 (12:29 +0000)
svn path=/trunk/; revision=47406

reactos/dll/win32/kernel32/file/npipe.c

index d62527e..55aeed9 100644 (file)
@@ -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