[4/8] crypt32: Remove unused variable and avoid a memory leak on error path. Part 2.

Dmitry Timoshkov dmitry at baikal.ru
Mon Oct 28 03:28:12 CDT 2013


---
 dlls/crypt32/object.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c
index 0ff1bfd..1ea896a 100644
--- a/dlls/crypt32/object.c
+++ b/dlls/crypt32/object.c
@@ -50,9 +50,8 @@ static BOOL CRYPT_ReadBlobFromFile(LPCWSTR fileName, PCERT_BLOB blob)
             blob->pbData = CryptMemAlloc(blob->cbData);
             if (blob->pbData)
             {
-                DWORD read;
-
-                ret = ReadFile(file, blob->pbData, blob->cbData, &read, NULL);
+                ret = ReadFile(file, blob->pbData, blob->cbData, NULL, NULL);
+                if (!ret) CryptMemFree(blob->pbData);
             }
         }
         CloseHandle(file);
-- 
1.8.4.1




More information about the wine-patches mailing list