[PATCH] windowscodecs: Fix memory leak.

Andrey Gusev andrey.goosev at gmail.com
Mon Jan 22 02:26:49 CST 2018


Signed-off-by: Andrey Gusev <andrey.goosev at gmail.com>
---
 dlls/windowscodecs/stream.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/dlls/windowscodecs/stream.c b/dlls/windowscodecs/stream.c
index 308ef8e02b..1fb3967b32 100644
--- a/dlls/windowscodecs/stream.c
+++ b/dlls/windowscodecs/stream.c
@@ -1009,8 +1009,10 @@ static HRESULT map_file(HANDLE file, HANDLE *map, void **mem, LARGE_INTEGER *siz
     if (!(*mem = MapViewOfFile(*map, FILE_MAP_READ, 0, 0, size->u.LowPart)))
     {
         CloseHandle(*map);
+        UnmapViewOfFile(mem);
         return HRESULT_FROM_WIN32(GetLastError());
     }
+    UnmapViewOfFile(mem);
     return S_OK;
 }
 
-- 
2.13.6




More information about the wine-devel mailing list