Michael Stefaniuc : ntdll: Fix missing unlock on error path. Found by Smatch.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 2 09:52:07 CDT 2007


Module: wine
Branch: master
Commit: bf6a96ca663852f24ff652f0dd3b8027ae787dc3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=bf6a96ca663852f24ff652f0dd3b8027ae787dc3

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Jun 29 22:50:18 2007 +0200

ntdll: Fix missing unlock on error path. Found by Smatch.

---

 dlls/ntdll/loader.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
index 2826d19..bdf09f3 100644
--- a/dlls/ntdll/loader.c
+++ b/dlls/ntdll/loader.c
@@ -1806,7 +1806,11 @@ NTSTATUS WINAPI LdrGetDllHandle( LPCWSTR load_path, ULONG flags, const UNICODE_S
         if (filename != buffer) RtlFreeHeap( GetProcessHeap(), 0, filename );
         if (status != STATUS_BUFFER_TOO_SMALL) break;
         /* grow the buffer and retry */
-        if (!(filename = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return STATUS_NO_MEMORY;
+        if (!(filename = RtlAllocateHeap( GetProcessHeap(), 0, size )))
+        {
+            status = STATUS_NO_MEMORY;
+            break;
+        }
     }
 
     if (status == STATUS_SUCCESS)




More information about the wine-cvs mailing list