Commit bd9701ad authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dplayx: Fix a possible memory leak on error path (Coverity).

parent 3acac5b2
......@@ -1593,17 +1593,12 @@ static HRESULT DP_IF_CreatePlayer( IDirectPlayImpl *This, void *lpMsgHdr, DPID *
player total */
lpPData = DP_CreatePlayer( This, lpidPlayer, lpPlayerName, dwCreateFlags,
hEvent, bAnsi );
if( lpPData == NULL )
{
return DPERR_CANTADDPLAYER;
}
/* Create the list object and link it in */
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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment