Commit e55a9536 authored by Colin Walters's avatar Colin Walters

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.
parent 49a5d0f6
......@@ -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)
if (!G_IS_INET_SOCKET_ADDRESS (sockaddr))
g_clear_object (&sockaddr);
addr = g_object_ref (g_inet_socket_address_get_address ((GInetSocketAddress *)sockaddr));
addresses = g_list_prepend (addresses, addr);
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