Free data if SCTP packet is delivered after transport destruction.

Follow up to:
https://webrtc-review.googlesource.com/c/src/+/184240

Bug: chromium:1127774
Change-Id: I1595d306f026f9d90cf71d8729133e46c2766c6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190640
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Taylor <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32526}
This commit is contained in:
Taylor Brandstetter
2020-10-27 18:57:39 -07:00
committed by Commit Bot
parent 4a423d5b6a
commit 37aaabbbe8

View File

@ -410,6 +410,7 @@ class SctpTransport::UsrSctpWrapper {
RTC_LOG(LS_ERROR)
<< "OnSctpInboundPacket: Failed to get transport for socket " << sock
<< "; possibly was already destroyed.";
free(data);
return 0;
}
// Sanity check that both methods of getting the SctpTransport pointer