diff --git a/dlls/dplayx/dplay.c b/dlls/dplayx/dplay.c index 16886149f7e..27e17c2541e 100644 --- a/dlls/dplayx/dplay.c +++ b/dlls/dplayx/dplay.c @@ -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 ); } } diff --git a/dlls/dplayx/name_server.c b/dlls/dplayx/name_server.c index e875c19063a..1fdfef63f0c 100644 --- a/dlls/dplayx/name_server.c +++ b/dlls/dplayx/name_server.c @@ -136,6 +136,7 @@ void NS_AddRemoteComputerAsNameServer( LPCVOID lpcNSAddrHdr if( lpCacheNode->data == NULL ) { ERR( "no memory for SESSIONDESC2\n" ); + HeapFree( GetProcessHeap(), 0, lpCacheNode ); return; }