[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: dplayx: Reorder some code to avoid memory leaks (coverity)
From: James Eder <jimportal () gmail ! com>
Date: 2012-10-29 15:12:41
Message-ID: CAP4VxRAUgLnV101gYgSKzyu3gwfjHA_H_yAjP2Kpr2yghdE2Vg () mail ! gmail ! com
[Download RAW message or body]
On Mon, Oct 29, 2012 at 2:20 AM, Rico Schüller <kgbricola@web.de> wrote:
> On 28.10.2012 16:13, André Hentschel wrote:
>>
>> - lpGData->lpRemoteData = lpNewData;
>> + lpGData->lpRemoteData = HeapAlloc( GetProcessHeap(),
>> HEAP_ZERO_MEMORY, sizeof( dwDataSize ) );
>> + CopyMemory( lpGData->lpRemoteData, lpData, dwDataSize );
>> lpGData->dwRemoteDataSize = dwDataSize;
>
>
>> - lpPData->lpRemoteData = lpNewData;
>> + lpPData->lpRemoteData = HeapAlloc( GetProcessHeap(),
>> HEAP_ZERO_MEMORY, sizeof( dwDataSize ) );
>> + CopyMemory( lpPData->lpRemoteData, lpData, dwDataSize );
>> lpPData->dwRemoteDataSize = dwDataSize;
>
>
> Is the HEAP_ZERO_MEMORY really needed? You may kill that too while you
> change those lines.
>
> Cheers
> Rico
>
>
I didn't look at the code too long but, sizeof( dwDataSize ) looks wrong too.
--
Jim
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic