mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
gthreadedresolver: Unref unexpected address
I don't believe any real app would hit this, but we do leak if it occurs. Spotted by static analysis. https://bugzilla.gnome.org/show_bug.cgi?id=733576
This commit is contained in:
parent
49a5d0f6f2
commit
e55a953642
@ -88,8 +88,13 @@ do_lookup_by_name (GTask *task,
|
||||
for (ai = res; ai; ai = ai->ai_next)
|
||||
{
|
||||
sockaddr = g_socket_address_new_from_native (ai->ai_addr, ai->ai_addrlen);
|
||||
if (!sockaddr || !G_IS_INET_SOCKET_ADDRESS (sockaddr))
|
||||
if (!sockaddr)
|
||||
continue;
|
||||
if (!G_IS_INET_SOCKET_ADDRESS (sockaddr))
|
||||
{
|
||||
g_clear_object (&sockaddr);
|
||||
continue;
|
||||
}
|
||||
|
||||
addr = g_object_ref (g_inet_socket_address_get_address ((GInetSocketAddress *)sockaddr));
|
||||
addresses = g_list_prepend (addresses, addr);
|
||||
|
Loading…
Reference in New Issue
Block a user