Bug 1017835: use array delete for SCTP/DTLS SendPacket data

This commit is contained in:
Randell Jesup 2014-06-28 04:19:29 -04:00
parent 08459e98bb
commit 411c633b52
2 changed files with 3 additions and 3 deletions

View File

@ -680,12 +680,12 @@ DataChannelConnection::SctpDtlsInput(TransportFlow *flow,
}
int
DataChannelConnection::SendPacket(const unsigned char *data, size_t len, bool release)
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;
if (release)
delete data;
delete [] data;
return res;
}

View File

@ -200,7 +200,7 @@ private:
#ifdef SCTP_DTLS_SUPPORTED
static void DTLSConnectThread(void *data);
int SendPacket(const unsigned char* data, size_t len, bool release);
int SendPacket(unsigned char data[], size_t len, bool release);
void SctpDtlsInput(TransportFlow *flow, const unsigned char *data, size_t len);
static int SctpDtlsOutput(void *addr, void *buffer, size_t length, uint8_t tos, uint8_t set_df);
#endif