mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 05:28:07 +02:00
initrd/tests: fix memleak in test_dhcp_vendor_class_id()
Having leaks in the tests, breaks running the test under valgrind. There must be no leaks. Fixes:c056cb9306('initrd: parse 'rd.net.dhcp.vendor-class' kernel cmdline arg') (cherry picked from commitbff23d15d4)
This commit is contained in:
parent
bba54613eb
commit
5bea8db7ca
1 changed files with 3 additions and 1 deletions
|
|
@ -1508,6 +1508,8 @@ test_dhcp_vendor_class_id (void)
|
||||||
s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting_ip4_config (connection));
|
s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting_ip4_config (connection));
|
||||||
g_assert_cmpstr (nm_setting_ip4_config_get_dhcp_vendor_class_identifier (s_ip4), ==, "testvci");
|
g_assert_cmpstr (nm_setting_ip4_config_get_dhcp_vendor_class_identifier (s_ip4), ==, "testvci");
|
||||||
|
|
||||||
|
nm_clear_pointer (&connections, g_hash_table_unref);
|
||||||
|
|
||||||
ARGV = NM_MAKE_STRV ("rd.net.dhcp.vendor-class",
|
ARGV = NM_MAKE_STRV ("rd.net.dhcp.vendor-class",
|
||||||
"ip=eno1:dhcp");
|
"ip=eno1:dhcp");
|
||||||
connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV, &hostname);
|
connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV, &hostname);
|
||||||
|
|
@ -1517,7 +1519,7 @@ test_dhcp_vendor_class_id (void)
|
||||||
s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting_ip4_config (connection));
|
s_ip4 = NM_SETTING_IP4_CONFIG (nm_connection_get_setting_ip4_config (connection));
|
||||||
g_assert (nm_setting_ip4_config_get_dhcp_vendor_class_identifier (s_ip4) == NULL);
|
g_assert (nm_setting_ip4_config_get_dhcp_vendor_class_identifier (s_ip4) == NULL);
|
||||||
|
|
||||||
|
nm_clear_pointer (&connections, g_hash_table_unref);
|
||||||
|
|
||||||
memset (vci_arg_long, 'A', 400);
|
memset (vci_arg_long, 'A', 400);
|
||||||
vci_long = g_strdup_printf ("rd.net.dhcp.vendor-class=%s", vci_arg_long);
|
vci_long = g_strdup_printf ("rd.net.dhcp.vendor-class=%s", vci_arg_long);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue