From 02557f973aed0fed7154fefe53d67e2935f918dc Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Fri, 13 Jun 2014 22:54:22 +0200 Subject: sd-dhcp-server: fix a leak We must use free instead of dhcp_lease_free here to avoid freeing client_id.data. --- src/libsystemd-network/sd-dhcp-server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libsystemd-network') diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c index 4ce10549d6..d9495024ab 100644 --- a/src/libsystemd-network/sd-dhcp-server.c +++ b/src/libsystemd-network/sd-dhcp-server.c @@ -697,8 +697,10 @@ int dhcp_server_handle_message(sd_dhcp_server *server, DHCPMessage *message, lease->address = req->requested_ip; lease->client_id.data = memdup(req->client_id.data, req->client_id.length); - if (!lease->client_id.data) + if (!lease->client_id.data) { + free(lease); return -ENOMEM; + } lease->client_id.length = req->client_id.length; } else lease = existing_lease; -- cgit v1.2.3-54-g00ecf