mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 21:27:19 +00:00
dplayx: Fix a possible memory leak on error path (Coverity).
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3acac5b221
commit
bd9701add8
|
@ -1593,17 +1593,12 @@ static HRESULT DP_IF_CreatePlayer( IDirectPlayImpl *This, void *lpMsgHdr, DPID *
|
||||||
player total */
|
player total */
|
||||||
lpPData = DP_CreatePlayer( This, lpidPlayer, lpPlayerName, dwCreateFlags,
|
lpPData = DP_CreatePlayer( This, lpidPlayer, lpPlayerName, dwCreateFlags,
|
||||||
hEvent, bAnsi );
|
hEvent, bAnsi );
|
||||||
|
|
||||||
if( lpPData == NULL )
|
|
||||||
{
|
|
||||||
return DPERR_CANTADDPLAYER;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create the list object and link it in */
|
/* Create the list object and link it in */
|
||||||
lpPList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPList ) );
|
lpPList = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof( *lpPList ) );
|
||||||
if( lpPList == NULL )
|
if( !lpPData || !lpPList )
|
||||||
{
|
{
|
||||||
FIXME( "Memory leak\n" );
|
HeapFree( GetProcessHeap(), 0, lpPData );
|
||||||
|
HeapFree( GetProcessHeap(), 0, lpPList );
|
||||||
return DPERR_CANTADDPLAYER;
|
return DPERR_CANTADDPLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue