WebRTC: Nullcheck DataChannel SendPacket calls.

This commit is contained in:
wolfbeast 2018-06-29 07:43:21 +02:00 committed by Roy Tam
commit ea5ece2be9
2 changed files with 5 additions and 2 deletions

View file

@ -654,7 +654,10 @@ int
DataChannelConnection::SendPacket(unsigned char data[], size_t len, bool release)
{
//LOG(("%p: SCTP/DTLS sent %ld bytes", this, len));
int res = mTransportFlow->SendPacket(data, len) < 0 ? 1 : 0;
int res = 0;
if (mTransportFlow) {
res = mTransportFlow->SendPacket(data, len) < 0 ? 1 : 0;
}
if (release)
delete [] data;
return res;