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

test: fix memory and fd leak in test-dhcp6-client

Fixes an issue reported in #22576.
This commit is contained in:
Yu Watanabe 2022-02-22 21:34:37 +09:00
parent 2e37084fc9
commit 8306912b0e

View File

@ -78,8 +78,6 @@ static int test_ifindex = 42;
static unsigned test_client_sent_message_count = 0;
static sd_dhcp6_client *client_ref = NULL;
STATIC_DESTRUCTOR_REGISTER(client_ref, sd_dhcp6_client_unrefp);
static void test_client_basic(void) {
_cleanup_(sd_dhcp6_client_unrefp) sd_dhcp6_client *client = NULL;
int v;
@ -1004,6 +1002,7 @@ static void test_dhcp6_client(void) {
assert_se(test_client_sent_message_count == 4);
assert_se(!sd_dhcp6_client_unref(client_ref));
test_fd[1] = safe_close(test_fd[1]);
}