diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.cpp b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.cpp index 6898b50..c50fb76 100644 --- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.cpp +++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.cpp @@ -578,8 +578,6 @@ static bool SendSTUNResponsePacket( IRawUDPSocket* pSocket, int nEncoding, uint3 { uint32 messageBuffer[ k_nSTUN_MaxPacketSize_Bytes / 4 ]; const int nByteCount = EncodeSTUNPacket( messageBuffer, k_nSTUN_BindingResponse, nEncoding, pTransactionID, toAddr, pubKey, cubKey, pAttrs, nAttrs ); - for ( int i = 0; i < nAttrs; ++i ) - delete []( pAttrs[i].m_pData ); if ( nByteCount == 0 ) return false; @@ -1555,10 +1553,8 @@ not_stun: { STUNAttribute attrUsername; attrUsername.m_nType = k_nSTUN_Attr_UserName; - int nUsernameLength = (int)m_strIncomingUsername.size(); - attrUsername.m_nLength = nUsernameLength; - attrUsername.m_pData = new uint32[ (nUsernameLength + 3) / 4 ]; - V_memcpy( (void*)attrUsername.m_pData, m_strIncomingUsername.c_str(), m_strIncomingUsername.size() ); + attrUsername.m_nLength = (int)m_strIncomingUsername.size(); + attrUsername.m_pData = reinterpret_cast( m_strIncomingUsername.c_str() ); outAttrs.AddToTail( attrUsername ); } diff --git a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.h b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.h index f069e70..2dfb491 100644 --- a/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.h +++ b/src/steamnetworkingsockets/clientlib/steamnetworkingsockets_ice_client.h @@ -405,7 +405,6 @@ namespace SteamNetworkingSocketsLib { void GatherInterfaces(); void UpdateKeepalive( ICESessionInterface *pIntf ); - uint32 GetInterfaceLocalPreference( const SteamNetworkingIPAddr& addr ); void Think_KeepAliveOnCandidates( SteamNetworkingMicroseconds usecNow ); void Think_DiscoverServerReflexiveCandidates();