supplicant/tests: fix memleaks in test code for valgrind

This commit is contained in:
Thomas Haller 2015-02-08 11:11:14 +01:00
parent d74a3d0a02
commit 624aa51614

View file

@ -111,7 +111,7 @@ test_wifi_open (void)
NMSettingConnection *s_con;
NMSettingWireless *s_wifi;
NMSettingIPConfig *s_ip4;
NMSupplicantConfig *config;
gs_unref_object NMSupplicantConfig *config;
GHashTable *hash;
char *uuid;
gboolean success;
@ -191,6 +191,7 @@ test_wifi_open (void)
validate_opt ("wifi-open", hash, "bssid", TYPE_KEYWORD, bssid_str, -1);
validate_opt ("wifi-open", hash, "key_mgmt", TYPE_KEYWORD, "NONE", -1);
g_hash_table_unref (hash);
g_object_unref (connection);
}
@ -206,7 +207,7 @@ test_wifi_wep_key (const char *detail,
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
NMSettingIPConfig *s_ip4;
NMSupplicantConfig *config;
gs_unref_object NMSupplicantConfig *config;
GHashTable *hash;
char *uuid;
gboolean success;
@ -305,6 +306,7 @@ test_wifi_wep_key (const char *detail,
validate_opt (detail, hash, "wep_tx_keyidx", TYPE_INT, GINT_TO_POINTER (0), -1);
validate_opt (detail, hash, "wep_key0", TYPE_BYTES, expected, expected_size);
g_hash_table_unref (hash);
g_object_unref (connection);
}
@ -343,7 +345,7 @@ test_wifi_wpa_psk (const char *detail,
NMSettingWireless *s_wifi;
NMSettingWirelessSecurity *s_wsec;
NMSettingIPConfig *s_ip4;
NMSupplicantConfig *config;
gs_unref_object NMSupplicantConfig *config;
GHashTable *hash;
char *uuid;
gboolean success;
@ -454,6 +456,7 @@ test_wifi_wpa_psk (const char *detail,
validate_opt (detail, hash, "group", TYPE_KEYWORD, "TKIP CCMP", -1);
validate_opt (detail, hash, "psk", key_type, expected, expected_size);
g_hash_table_unref (hash);
g_object_unref (connection);
}