[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [3/8] crypt32: Remove unused variable and avoid a memory leak on error path.
From:       Alexandre Julliard <julliard () winehq ! org>
Date:       2013-10-28 18:29:13
Message-ID: 87mwlt2qrq.fsf () wine ! dyndns ! org
[Download RAW message or body]

Dmitry Timoshkov <dmitry@baikal.ru> writes:

> ---
>  dlls/crypt32/filestore.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/dlls/crypt32/filestore.c b/dlls/crypt32/filestore.c
> index 44b9bbb..6084395 100644
> --- a/dlls/crypt32/filestore.c
> +++ b/dlls/crypt32/filestore.c
> @@ -117,9 +117,8 @@ static BOOL CRYPT_ReadBlobFromFile(HANDLE file, 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);

In general if the read size is not checked that's a bug.

-- 
Alexandre Julliard
julliard@winehq.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic