device: fix stale pointer in nm_device_get_hostname_from_dns_lookup()

Fixes: 09c8387114 ('policy: use the hostname setting')

https://bugzilla.redhat.com/show_bug.cgi?id=1917713
This commit is contained in:
Beniamino Galvani
2021-01-19 11:11:13 +01:00
parent 4367785007
commit e2d04e18d5

View File

@@ -17714,7 +17714,7 @@ nm_device_get_hostname_from_dns_lookup(NMDevice *self, int addr_family, gboolean
* the resolution with the new address */
if (address_changed) {
nm_clear_g_cancellable(&resolver->cancellable);
nm_g_object_unref(resolver->address);
g_clear_object(&resolver->address);
resolver->state = RESOLVER_WAIT_ADDRESS;
}