diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c index 0ff1bfd0cbd..39955ce6b3a 100644 --- a/dlls/crypt32/object.c +++ b/dlls/crypt32/object.c @@ -52,7 +52,8 @@ static BOOL CRYPT_ReadBlobFromFile(LPCWSTR fileName, PCERT_BLOB blob) { DWORD read; - ret = ReadFile(file, blob->pbData, blob->cbData, &read, NULL); + ret = ReadFile(file, blob->pbData, blob->cbData, &read, NULL) && read == blob->cbData; + if (!ret) CryptMemFree(blob->pbData); } } CloseHandle(file);