X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Flibsystemd-dhcp%2Fdhcp-client.c;h=01d406c27b3cc946958b8f45c95ccb078a0c2705;hb=a94200d0b4a8f98e5d9433282642300082de7d59;hp=03a846df39d9d0dcdc8b476a562c34fd32989afb;hpb=751246ee37cf0cd72baf378f1b9c1ac04f8b8c9b;p=elogind.git diff --git a/src/libsystemd-dhcp/dhcp-client.c b/src/libsystemd-dhcp/dhcp-client.c index 03a846df3..01d406c27 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;