n-dhcp4: client/connection: fix memory leak

Free the request when the connection gets destroyed.

Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>

https://github.com/nettools/n-dhcp4/pull/1
This commit is contained in:
Beniamino Galvani
2019-06-13 16:53:13 +02:00
parent 40babe1c44
commit 46f81e18f7

View File

@@ -84,6 +84,7 @@ int n_dhcp4_c_connection_init(NDhcp4CConnection *connection,
*/
void n_dhcp4_c_connection_deinit(NDhcp4CConnection *connection) {
n_dhcp4_c_connection_close(connection);
n_dhcp4_outgoing_free(connection->request);
*connection = (NDhcp4CConnection)N_DHCP4_C_CONNECTION_NULL(*connection);
}