Commit 90d939ea authored by Sam Gigliotti's avatar Sam Gigliotti Committed by Luis de Bethencourt

webrtcbin: Fixed memory leak in gstwebrtcstats

The function _get_stats_from_ice_transport returns a string which must be
freed by the caller. However, _get_stats_from_dtls_transport was ignoring
the return value from this function, resulting in a leak.

Ran this with valgrind. Before this fix there was a leak of 40 bytes each
time this was called. After there was no leak.
parent 02814a43
Pipeline #60257 failed with stages
in 34 minutes and 52 seconds
......@@ -353,6 +353,7 @@ _get_stats_from_dtls_transport (GstWebRTCBin * webrtc,
GstStructure *stats;
gchar *id;
double ts;
gchar *ice_id;
gst_structure_get_double (s, "timestamp", &ts);
......@@ -395,7 +396,8 @@ _get_stats_from_dtls_transport (GstWebRTCBin * webrtc,
gst_structure_set (s, id, GST_TYPE_STRUCTURE, stats, NULL);
gst_structure_free (stats);
_get_stats_from_ice_transport (webrtc, transport->transport, s);
ice_id = _get_stats_from_ice_transport (webrtc, transport->transport, s);
g_free (ice_id);
return id;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment