summaryrefslogtreecommitdiff
path: root/src/libsystemd-dhcp/test-dhcp-client.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-31 11:57:38 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-31 13:00:57 -0500
commit7a7c74cae4db0c35cbe54d9bad8418a605cb870f (patch)
tree019942adb3e3186d9fcaff32c895048449ed5afc /src/libsystemd-dhcp/test-dhcp-client.c
parentaa9ed6538985d667aa6a0264c59622a51384ccd6 (diff)
dhcp: fix creation of req_opts array
GREEDY_REALLOC needs to have two size variables: one for the allocated size, and a second one for the used size. Using the allocated size only lead to leaving some elements unitialized and assigning some more than once.
Diffstat (limited to 'src/libsystemd-dhcp/test-dhcp-client.c')
-rw-r--r--src/libsystemd-dhcp/test-dhcp-client.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsystemd-dhcp/test-dhcp-client.c b/src/libsystemd-dhcp/test-dhcp-client.c
index 617236b5df..929b869ec3 100644
--- a/src/libsystemd-dhcp/test-dhcp-client.c
+++ b/src/libsystemd-dhcp/test-dhcp-client.c
@@ -85,6 +85,7 @@ static void test_request_basic(sd_event *e)
assert(sd_dhcp_client_set_request_option(client, 33) == 0);
assert(sd_dhcp_client_set_request_option(client, 33) == -EEXIST);
assert(sd_dhcp_client_set_request_option(client, 44) == 0);
+ assert(sd_dhcp_client_set_request_option(client, 33) == -EEXIST);
}
static uint16_t client_checksum(void *buf, int len)