[PATCH 2/2] Release buffer when it won't be referenced.

Nikolay Sivov bunglehead at gmail.com
Fri Jan 8 09:07:12 CST 2010


On failures previously allocated buffer isn't referenced, so it's leaked.
---
 dlls/ntdll/path.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
index 66d7b7a..8b62a3a 100644
--- a/dlls/ntdll/path.c
+++ b/dlls/ntdll/path.c
@@ -662,9 +662,11 @@ static ULONG get_full_path_helper(LPCWSTR name, LPWSTR buffer, ULONG size)
                 tmp[1] = ':';
                 tmp[2] = '\\';
                 ins_str = tmp;
+                RtlFreeHeap(GetProcessHeap(), 0, val.Buffer);
                 break;
             default:
                 ERR("Unsupported status code\n");
+                RtlFreeHeap(GetProcessHeap(), 0, val.Buffer);
                 break;
             }
             mark = 3;
-- 
1.5.6.5


--=-+gjxJTDwmPtecDne+d5b--




More information about the wine-patches mailing list