ibft/tests: fix memleaks in test code for valgrind

This commit is contained in:
Thomas Haller 2015-02-07 16:02:36 +01:00
parent 9a2f2ed7fd
commit fbe8c0ed87

View file

@ -63,7 +63,7 @@ read_block (const char *iscsiadm_path, const char *expected_mac)
}
g_assert (block);
g_slist_foreach (blocks, (GFunc) g_ptr_array_unref, NULL);
g_slist_free_full (blocks, (GDestroyNotify) g_ptr_array_unref);
return block;
}
@ -110,6 +110,7 @@ test_read_ibft_dhcp (void)
g_assert_cmpstr (nm_setting_ip_config_get_method (s_ip4), ==, NM_SETTING_IP4_CONFIG_METHOD_AUTO);
g_object_unref (connection);
g_ptr_array_unref (block);
}
static void
@ -266,7 +267,7 @@ test_read_ibft_vlan (void)
g_assert_cmpstr (nm_setting_ip_config_get_gateway (s_ip4), ==, NULL);
g_object_unref (connection);
g_ptr_array_ref (block);
g_ptr_array_unref (block);
}
NMTST_DEFINE ();