chiark / gitweb /
test-dhcp-client: unref lease objects to make valgrind happy
[elogind.git] / src / libsystemd-network / sd-dhcp-client.c
index c67de71..4892203 100644 (file)
@@ -805,6 +805,7 @@ static int client_handle_offer(sd_dhcp_client *client, DHCPMessage *offer,
                 }
         }
 
+        sd_dhcp_lease_unref(client->lease);
         client->lease = lease;
         lease = NULL;
 
@@ -1330,6 +1331,8 @@ sd_dhcp_client *sd_dhcp_client_unref(sd_dhcp_client *client) {
 
                 sd_dhcp_client_detach_event(client);
 
+                sd_dhcp_lease_unref(client->lease);
+
                 free(client->req_opts);
                 free(client);