Commit ce41fa26 by 夏楚 Committed by GitHub

Merge pull request #1053 from johzzy/master

fix stun packet memory leak.
parents 94a6dc66 6f3f69b4
......@@ -238,12 +238,12 @@ bool is_rtcp(char *buf) {
void WebRtcTransport::inputSockData(char *buf, int len, RTC::TransportTuple *tuple) {
if (RTC::StunPacket::IsStun((const uint8_t *) buf, len)) {
RTC::StunPacket *packet = RTC::StunPacket::Parse((const uint8_t *) buf, len);
if (packet == nullptr) {
std::unique_ptr<RTC::StunPacket> packet(RTC::StunPacket::Parse((const uint8_t *) buf, len));
if (!packet) {
WarnL << "parse stun error" << std::endl;
return;
}
_ice_server->ProcessStunPacket(packet, tuple);
_ice_server->ProcessStunPacket(packet.get(), tuple);
return;
}
if (is_dtls(buf)) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论