dplayx: Fix some memory leaks.

This commit is contained in:
Andrew Talbot 2007-09-22 15:40:15 +01:00 committed by Alexandre Julliard
parent 6858ce73b6
commit 5ab977e2aa
2 changed files with 8 additions and 0 deletions

View file

@ -3727,8 +3727,10 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections
&sizeOfReturnBuffer ) != ERROR_SUCCESS )
{
ERR(": missing GUID registry data members\n" );
RegCloseKey(hkServiceProvider);
continue;
}
RegCloseKey(hkServiceProvider);
/* FIXME: Check return types to ensure we're interpreting data right */
MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, sizeof(buff)/sizeof(WCHAR) );
@ -3822,8 +3824,10 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections
&sizeOfReturnBuffer ) != ERROR_SUCCESS )
{
ERR(": missing GUID registry data members\n" );
RegCloseKey(hkServiceProvider);
continue;
}
RegCloseKey(hkServiceProvider);
/* FIXME: Check return types to ensure we're interpreting data right */
MultiByteToWideChar( CP_ACP, 0, returnBuffer, -1, buff, sizeof(buff)/sizeof(WCHAR) );
@ -3861,6 +3865,7 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections
&dwAddressBufferSize, TRUE ) ) != DP_OK )
{
ERR( "can't create address: %s\n", DPLAYX_HresultToString( hr ) );
HeapFree( GetProcessHeap(), 0, lpAddressBuffer );
return hr;
}
@ -3868,8 +3873,10 @@ static HRESULT WINAPI DirectPlay3AImpl_EnumConnections
if( !lpEnumCallback( &serviceProviderGUID, lpAddressBuffer, dwAddressBufferSize,
&dpName, DPCONNECTION_DIRECTPLAYLOBBY, lpContext ) )
{
HeapFree( GetProcessHeap(), 0, lpAddressBuffer );
return DP_OK;
}
HeapFree( GetProcessHeap(), 0, lpAddressBuffer );
}
}

View file

@ -136,6 +136,7 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr
if( lpCacheNode->data == NULL )
{
ERR( "no memory for SESSIONDESC2\n" );
HeapFree( GetProcessHeap(), 0, lpCacheNode );
return;
}