mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
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.
This commit is contained in:
parent
02814a43da
commit
90d939ea36
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue