Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.cc

Issue 1901593002: Fixed memleak when two voip blocks present in single rtcp packet. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.cc
index a5c0e2828282fad6bef0d695980542dec5c00c43..bfcc1bdfde02d4b822d367f4f3404d335f761d05 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.cc
@@ -42,14 +42,13 @@ RTCPPacketInformation::RTCPPacketInformation()
RTCPPacketInformation::~RTCPPacketInformation()
{
delete [] applicationData;
- delete VoIPMetric;
}
void
RTCPPacketInformation::AddVoIPMetric(const RTCPVoIPMetric* metric)
{
- VoIPMetric = new RTCPVoIPMetric();
- memcpy(VoIPMetric, metric, sizeof(RTCPVoIPMetric));
+ VoIPMetric.reset(new RTCPVoIPMetric());
+ memcpy(VoIPMetric.get(), metric, sizeof(RTCPVoIPMetric));
}
void RTCPPacketInformation::AddApplicationData(const uint8_t* data,
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtcp_receiver_help.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698