From 106c156b0f6f8ba77f3dd2e144af3e1f4834ecc0 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 13 Jun 2019 17:00:34 +0200 Subject: [PATCH] n-dhcp4: client/probe: fix memory leak The probe takes a reference to the current lease and so it must release it upon destruction. Signed-off-by: Beniamino Galvani https://github.com/nettools/n-dhcp4/pull/1 --- shared/n-dhcp4/src/n-dhcp4-c-probe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/n-dhcp4/src/n-dhcp4-c-probe.c b/shared/n-dhcp4/src/n-dhcp4-c-probe.c index 67fedafffa..308cff8307 100644 --- a/shared/n-dhcp4/src/n-dhcp4-c-probe.c +++ b/shared/n-dhcp4/src/n-dhcp4-c-probe.c @@ -483,6 +483,7 @@ _c_public_ NDhcp4ClientProbe *n_dhcp4_client_probe_free(NDhcp4ClientProbe *probe if (probe == probe->client->current_probe) probe->client->current_probe = NULL; + n_dhcp4_client_lease_unref(probe->current_lease); n_dhcp4_c_connection_deinit(&probe->connection); n_dhcp4_client_unref(probe->client); n_dhcp4_client_probe_config_free(probe->config);