From d2fe46b514ef3f6e0c0eb16b2d853c6dd6fa1808 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Mon, 9 Dec 2013 23:43:32 +0200 Subject: dhcp: Add function to free DHCP client data --- src/libsystemd-dhcp/dhcp-client.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/libsystemd-dhcp') diff --git a/src/libsystemd-dhcp/dhcp-client.c b/src/libsystemd-dhcp/dhcp-client.c index 03a846df39..01d406c27b 100644 --- a/src/libsystemd-dhcp/dhcp-client.c +++ b/src/libsystemd-dhcp/dhcp-client.c @@ -961,6 +961,19 @@ int sd_dhcp_client_stop(sd_dhcp_client *client) return client_stop(client, DHCP_EVENT_STOP); } +sd_dhcp_client *sd_dhcp_client_free(sd_dhcp_client *client) +{ + assert_return(client, NULL); + + sd_dhcp_client_stop(client); + + sd_event_unref(client->event); + free(client->req_opts); + free(client); + + return NULL; +} + sd_dhcp_client *sd_dhcp_client_new(sd_event *event) { sd_dhcp_client *client; -- cgit v1.2.3-54-g00ecf