mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 08:58:03 +02:00
initrd: fix leak in test
Fixes:6069ef4b8b('initrd: accept a zero-byte prefix for BOOTIF') (cherry picked from commit07ee187cb5)
This commit is contained in:
parent
516433f769
commit
aa2bc9e6e4
1 changed files with 7 additions and 6 deletions
|
|
@ -1952,18 +1952,19 @@ test_bootif_no_ip(void)
|
||||||
static void
|
static void
|
||||||
test_bootif_hwtype(void)
|
test_bootif_hwtype(void)
|
||||||
{
|
{
|
||||||
gs_unref_hashtable GHashTable *connections = NULL;
|
|
||||||
const char *const *ARGV0 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03");
|
const char *const *ARGV0 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=01-00-53-AB-cd-02-03");
|
||||||
const char *const *ARGV1 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=00-00-53-Ab-cD-02-03");
|
const char *const *ARGV1 = NM_MAKE_STRV("ip=eth0:dhcp", "BOOTIF=00-00-53-Ab-cD-02-03");
|
||||||
const char *const *ARGV[] = {ARGV0, ARGV1};
|
const char *const *ARGV[] = {ARGV0, ARGV1};
|
||||||
NMConnection * connection;
|
|
||||||
NMSettingWired * s_wired;
|
|
||||||
NMSettingIPConfig *s_ip4;
|
|
||||||
NMSettingIPConfig *s_ip6;
|
|
||||||
gs_free char * hostname = NULL;
|
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS(ARGV); i++) {
|
for (i = 0; i < G_N_ELEMENTS(ARGV); i++) {
|
||||||
|
gs_unref_hashtable GHashTable *connections = NULL;
|
||||||
|
NMConnection * connection;
|
||||||
|
NMSettingWired * s_wired;
|
||||||
|
NMSettingIPConfig * s_ip4;
|
||||||
|
NMSettingIPConfig * s_ip6;
|
||||||
|
gs_free char * hostname = NULL;
|
||||||
|
|
||||||
connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV[i], &hostname);
|
connections = nmi_cmdline_reader_parse(TEST_INITRD_DIR "/sysfs", ARGV[i], &hostname);
|
||||||
g_assert(connections);
|
g_assert(connections);
|
||||||
g_assert_cmpint(g_hash_table_size(connections), ==, 2);
|
g_assert_cmpint(g_hash_table_size(connections), ==, 2);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue