Fix redefinition of local variable in gio/gnetworkservice.c

This commit is contained in:
Loic Le Page 2022-01-19 18:47:38 +01:00 committed by Loïc Le Page
parent dd96eeee74
commit 124733d10c

View File

@ -445,7 +445,7 @@ g_network_service_address_enumerator_next (GSocketAddressEnumerator *enumerator
{
if (srv_enum->addr_enum == NULL && srv_enum->t)
{
GError *error = NULL;
GError *my_error = NULL;
gchar *uri;
gchar *hostname;
GSocketConnectable *addr;
@ -477,15 +477,15 @@ g_network_service_address_enumerator_next (GSocketAddressEnumerator *enumerator
addr = g_network_address_parse_uri (uri,
g_srv_target_get_port (target),
&error);
&my_error);
g_free (uri);
if (addr == NULL)
{
if (srv_enum->error == NULL)
srv_enum->error = error;
srv_enum->error = my_error;
else
g_error_free (error);
g_error_free (my_error);
continue;
}
@ -498,18 +498,18 @@ g_network_service_address_enumerator_next (GSocketAddressEnumerator *enumerator
if (srv_enum->addr_enum)
{
GError *error = NULL;
GError *my_error = NULL;
ret = g_socket_address_enumerator_next (srv_enum->addr_enum,
cancellable,
&error);
&my_error);
if (error)
if (my_error)
{
if (srv_enum->error == NULL)
srv_enum->error = error;
srv_enum->error = my_error;
else
g_error_free (error);
g_error_free (my_error);
}
if (!ret)