1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

sd-dhcp-client: fix invalid free() in client_send_request()

static int client_send_request(...) in
./src/libsystemd-network/sd-dhcp-client.c tries to initialize
"request" by calling client_message_init(...), which has atleast
5 error cases where it can return without that happening.
This leads to the function finishing without "request" being initialized.
This commit is contained in:
Andreas Henriksson 2014-06-13 18:48:20 +02:00 committed by Tom Gundersen
parent 97578344f3
commit 8186d9dda0

View File

@ -413,7 +413,7 @@ static int client_send_discover(sd_dhcp_client *client) {
}
static int client_send_request(sd_dhcp_client *client) {
_cleanup_free_ DHCPPacket *request;
_cleanup_free_ DHCPPacket *request = NULL;
size_t optoffset, optlen;
int r;