mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-27 09:38:17 +00:00
webrtc: Plug leaks of resolved ICE addresses
The addresses we get from `resolve_host_finish()` (via `resolve_host_async()`, `resolve_host_main_cb()`, `on_resolve_host()`, `g_resolver_lookup_by_name_finish()`) must be freed. Otherwise we leak memory. Leak found and confirmed fixed with GCC AddressSanitizer. Change-Id: If32d24452d626234f01b253b77a7d6d16eac1cee Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4469>
This commit is contained in:
parent
b14e675a27
commit
2fed3bf6c4
1 changed files with 4 additions and 0 deletions
|
@ -759,6 +759,8 @@ on_candidate_resolved (GstWebRTCICE * ice, GAsyncResult * res,
|
|||
}
|
||||
|
||||
new_addr = g_inet_address_to_string (addresses->data);
|
||||
g_resolver_free_addresses (addresses);
|
||||
addresses = NULL;
|
||||
|
||||
new_candv[0] = rc->prefix;
|
||||
new_candv[1] = new_addr;
|
||||
|
@ -1361,6 +1363,8 @@ on_http_proxy_resolved (GstWebRTCICE * ice, GAsyncResult * res,
|
|||
|
||||
/* XXX: only the first IP is used */
|
||||
ip = g_inet_address_to_string (addresses->data);
|
||||
g_resolver_free_addresses (addresses);
|
||||
addresses = NULL;
|
||||
|
||||
if (!ip) {
|
||||
GST_ERROR_OBJECT (ice, "failed to resolve host for proxy");
|
||||
|
|
Loading…
Reference in a new issue