From 7825a710466eb8fc5e80715ed6b974960b332990 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Sat, 28 Jun 2014 04:26:34 -0400 Subject: [PATCH] Bug 1017835: use array delete for SCTP/DTLS SendPacket data r=jib DONTBUILD --- netwerk/sctp/datachannel/DataChannel.cpp | 4 ++-- netwerk/sctp/datachannel/DataChannel.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp index 1aa4ae625d5c..b1ffc11e1534 100644 --- a/netwerk/sctp/datachannel/DataChannel.cpp +++ b/netwerk/sctp/datachannel/DataChannel.cpp @@ -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; } diff --git a/netwerk/sctp/datachannel/DataChannel.h b/netwerk/sctp/datachannel/DataChannel.h index bec2fc7fa91c..6b6e3c967227 100644 --- a/netwerk/sctp/datachannel/DataChannel.h +++ b/netwerk/sctp/datachannel/DataChannel.h @@ -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