diff --git a/gio/gproxyaddressenumerator.c b/gio/gproxyaddressenumerator.c index 0d1539a9d..d173b61c3 100644 --- a/gio/gproxyaddressenumerator.c +++ b/gio/gproxyaddressenumerator.c @@ -285,14 +285,10 @@ g_proxy_address_enumerator_next (GSocketAddressEnumerator *enumerator, { dest_hostname = g_strdup (priv->dest_hostname); } + + g_assert (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address)); + dest_protocol = g_uri_parse_scheme (priv->dest_uri); - - if (!G_IS_INET_SOCKET_ADDRESS (priv->proxy_address)) - { - g_free (dest_hostname); - g_free (dest_protocol); - } - g_return_val_if_fail (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address), NULL); inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address); inetaddr = g_inet_socket_address_get_address (inetsaddr); @@ -363,7 +359,6 @@ return_result (GTask *task) { GProxyAddressEnumeratorPrivate *priv = g_task_get_task_data (task); GSocketAddress *result; - gboolean is_inet_socket_address; if (strcmp ("direct", priv->proxy_type) == 0) { @@ -395,13 +390,7 @@ return_result (GTask *task) } dest_protocol = g_uri_parse_scheme (priv->dest_uri); - is_inet_socket_address = G_IS_INET_SOCKET_ADDRESS (priv->proxy_address); - if (!is_inet_socket_address) - { - g_free (dest_hostname); - g_free (dest_protocol); - } - g_return_if_fail (is_inet_socket_address); + g_assert (G_IS_INET_SOCKET_ADDRESS (priv->proxy_address)); inetsaddr = G_INET_SOCKET_ADDRESS (priv->proxy_address); inetaddr = g_inet_socket_address_get_address (inetsaddr);