From 0acd1d322bb4bc1f12149a2e1fe4a27738fb9647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Thu, 14 Apr 2011 16:57:34 +0200 Subject: [PATCH] ifcfg-rh: fix some memory leaks in tests (test-ifcfg-rh.c) --- .../plugins/ifcfg-rh/tests/test-ifcfg-rh.c | 314 ++++++++++++++++-- 1 file changed, 290 insertions(+), 24 deletions(-) diff --git a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c index a8e7cc3c86..81d8094659 100644 --- a/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c +++ b/src/settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c @@ -327,6 +327,10 @@ test_read_minimal (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_NEVER_DEFAULT); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -445,6 +449,7 @@ test_read_unmanaged (void) TEST_IFCFG_UNMANAGED, NM_SETTING_IP4_CONFIG_SETTING_NAME); + g_free (unmanaged); g_object_unref (connection); } @@ -456,7 +461,7 @@ test_read_wired_static (const char *file, const char *expected_id) NMSettingWired *s_wired; NMSettingIP4Config *s_ip4; NMSettingIP6Config *s_ip6; - char *unmanaged = FALSE; + char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; @@ -494,7 +499,7 @@ test_read_wired_static (const char *file, const char *expected_id) ASSERT (nm_connection_verify (connection, &error), "wired-static-verify", "failed to verify %s: %s", file, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-static-verify", "failed to verify %s: unexpected unmanaged value", file); /* ===== CONNECTION SETTING ===== */ @@ -748,6 +753,10 @@ test_read_wired_static (const char *file, const char *expected_id) file); } + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -759,7 +768,7 @@ test_read_wired_static_no_prefix (guint32 expected_prefix) NMConnection *connection; NMSettingConnection *s_con; NMSettingIP4Config *s_ip4; - char *unmanaged = FALSE; + char *unmanaged = NULL; char *keyfile = NULL; char *routefile = NULL; char *route6file = NULL; @@ -793,7 +802,7 @@ test_read_wired_static_no_prefix (guint32 expected_prefix) ASSERT (nm_connection_verify (connection, &error), "wired-static-no-prefix-verify", "failed to verify %s: %s", file, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-static-no-prefix-verify", "failed to verify %s: unexpected unmanaged value", file); /* ===== CONNECTION SETTING ===== */ @@ -855,6 +864,10 @@ test_read_wired_static_no_prefix (guint32 expected_prefix) NM_SETTING_IP4_CONFIG_ADDRESSES); g_free (file); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -898,7 +911,7 @@ test_read_wired_dhcp (void) ASSERT (nm_connection_verify (connection, &error), "wired-dhcp-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_DHCP, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-dhcp-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DHCP); /* ===== CONNECTION SETTING ===== */ @@ -1025,7 +1038,10 @@ test_read_wired_dhcp (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS); - + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -1068,7 +1084,7 @@ test_read_wired_global_gateway (void) ASSERT (nm_connection_verify (connection, &error), "wired-global-gateway-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_GLOBAL_GATEWAY, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-global-gateway-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_GLOBAL_GATEWAY); /* ===== CONNECTION SETTING ===== */ @@ -1152,6 +1168,10 @@ test_read_wired_global_gateway (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -1191,7 +1211,7 @@ test_read_wired_never_default (void) ASSERT (nm_connection_verify (connection, &error), "wired-never-default-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_NEVER_DEFAULT, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-never-default-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_NEVER_DEFAULT); /* ===== CONNECTION SETTING ===== */ @@ -1274,6 +1294,10 @@ test_read_wired_never_default (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -1312,7 +1336,7 @@ test_read_wired_defroute_no (void) ASSERT (nm_connection_verify (connection, &error), "wired-defroute-no-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_DEFROUTE_NO, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-defroute-no-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DEFROUTE_NO); /* ===== CONNECTION SETTING ===== */ @@ -1388,6 +1412,10 @@ test_read_wired_defroute_no (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -1433,7 +1461,7 @@ test_read_wired_defroute_no_gatewaydev_yes (void) TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-defroute-no-gatewaydev-yes-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DEFROUTE_NO_GATEWAYDEV_YES); @@ -1511,6 +1539,10 @@ test_read_wired_defroute_no_gatewaydev_yes (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_NEVER_DEFAULT); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -1672,6 +1704,7 @@ test_read_wired_static_routes (void) "wired-static-routes-verify-ip4", "failed to verify %s: unexpected route metric #2", TEST_IFCFG_WIRED_STATIC_ROUTES); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -1877,6 +1910,7 @@ test_read_wired_static_routes_legacy (void) "wired-static-routes-legacy-verify-ip4", "failed to verify %s: unexpected destination route #3 metric", TEST_IFCFG_WIRED_STATIC_ROUTES_LEGACY); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -1922,7 +1956,7 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) ASSERT (nm_connection_verify (connection, &error), "wired-ipv4-manual-verify", "failed to verify %s: %s", file, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-ipv4-manual-verify", "failed to verify %s: unexpected unmanaged value", file); /* ===== CONNECTION SETTING ===== */ @@ -2028,6 +2062,7 @@ test_read_wired_ipv4_manual (const char *file, const char *expected_id) "wired-ipv4-manual-verify-ip4", "failed to verify %s: unexpected IP4 address #3", file); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -2084,7 +2119,7 @@ test_read_wired_ipv6_manual (void) ASSERT (nm_connection_verify (connection, &error), "wired-ipv6-manual-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_IPV6_MANUAL, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-ipv6-manual-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_IPV6_MANUAL); /* ===== CONNECTION SETTING ===== */ @@ -2327,6 +2362,7 @@ test_read_wired_ipv6_manual (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_DNS); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -2374,7 +2410,7 @@ test_read_wired_ipv6_only (void) ASSERT (nm_connection_verify (connection, &error), "wired-ipv6-only-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_IPV6_ONLY, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-ipv6-only-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_IPV6_MANUAL); /* ===== CONNECTION SETTING ===== */ @@ -2484,6 +2520,7 @@ test_read_wired_ipv6_only (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_DNS); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -2526,7 +2563,7 @@ test_read_wired_dhcp6_only (void) ASSERT (nm_connection_verify (connection, &error), "wired-dhcp6-only-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_DHCP6_ONLY, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-dhcp6-only-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_DHCP6_ONLY); /* ===== CONNECTION SETTING ===== */ @@ -2589,6 +2626,7 @@ test_read_wired_dhcp6_only (void) NM_SETTING_IP6_CONFIG_SETTING_NAME, NM_SETTING_IP6_CONFIG_METHOD); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -2625,7 +2663,7 @@ test_read_onboot_no (void) ASSERT (nm_connection_verify (connection, &error), "onboot-no-verify", "failed to verify %s: %s", TEST_IFCFG_ONBOOT_NO, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "onboot-no-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_ONBOOT_NO); /* ===== CONNECTION SETTING ===== */ @@ -2643,6 +2681,10 @@ test_read_onboot_no (void) NM_SETTING_CONNECTION_SETTING_NAME, NM_SETTING_CONNECTION_AUTOCONNECT); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -2686,7 +2728,7 @@ test_read_wired_8021x_peap_mschapv2 (void) ASSERT (nm_connection_verify (connection, &error), "wired-8021x-peap-mschapv2-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-8021x-peap-mschapv2-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_8021x_PEAP_MSCHAPV2); /* ===== WIRED SETTING ===== */ @@ -2829,6 +2871,10 @@ test_read_wired_8021x_peap_mschapv2 (void) g_object_unref (tmp_8021x); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -2892,6 +2938,10 @@ test_read_wired_8021x_tls_secret_flags (const char *ifcfg, NMSettingSecretFlags g_free (dirname); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -3070,6 +3120,10 @@ test_read_wifi_open (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -3148,6 +3202,10 @@ test_read_wifi_open_auto (void) NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_MODE); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -3232,7 +3290,11 @@ test_read_wifi_open_ssid_hex (void) TEST_IFCFG_WIFI_OPEN_SSID_HEX, NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID); - + + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -3259,6 +3321,11 @@ test_read_wifi_open_ssid_bad (const char *file, const char *test) &ignore_error); ASSERT (connection == NULL, test, "unexpected success reading %s", file); g_clear_error (&error); + + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); } #define TEST_IFCFG_WIFI_OPEN_SSID_QUOTED TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-quoted" @@ -3342,7 +3409,11 @@ test_read_wifi_open_ssid_quoted (void) TEST_IFCFG_WIFI_OPEN_SSID_QUOTED, NM_SETTING_WIRELESS_SETTING_NAME, NM_SETTING_WIRELESS_SSID); - + + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -3616,6 +3687,10 @@ test_read_wifi_wep (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -3880,6 +3955,10 @@ test_read_wifi_wep_adhoc (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_DNS); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4016,6 +4095,10 @@ test_read_wifi_wep_passphrase (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4149,6 +4232,10 @@ test_read_wifi_wep_40_ascii (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4282,6 +4369,10 @@ test_read_wifi_wep_104_ascii (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY3); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4418,6 +4509,10 @@ test_read_wifi_leap (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4473,6 +4568,10 @@ test_read_wifi_leap_secret_flags (const char *file, NMSettingSecretFlags expecte g_assert (nm_setting_wireless_security_get_leap_password_flags (s_wsec) == expected_flags); g_assert (nm_setting_wireless_security_get_leap_password (s_wsec) == NULL); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4788,6 +4887,10 @@ test_read_wifi_wpa_psk (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4889,6 +4992,10 @@ test_read_wifi_wpa_psk_unquoted (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_PSK); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -4922,6 +5029,11 @@ test_read_wifi_wpa_psk_unquoted2 (void) ASSERT (connection == NULL, "wifi-wpa-psk-unquoted-read", "unexpected success reading %s", TEST_IFCFG_WIFI_WPA_PSK_UNQUOTED2); g_clear_error (&error); + + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); } #define TEST_IFCFG_WIFI_WPA_PSK_ADHOC TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-wpa-psk-adhoc" @@ -5109,6 +5221,10 @@ test_read_wifi_wpa_psk_adhoc (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -5261,6 +5377,10 @@ test_read_wifi_wpa_psk_hex (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -5302,7 +5422,7 @@ test_read_wifi_wpa_eap_tls (void) ASSERT (nm_connection_verify (connection, &error), "wifi-wpa-eap-tls-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TLS, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wifi-wpa-eap-tls-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIFI_WPA_EAP_TLS); /* ===== WIRELESS SETTING ===== */ @@ -5408,6 +5528,10 @@ test_read_wifi_wpa_eap_tls (void) "wifi-wpa-eap-tls-verify-8021x", NM_SETTING_802_1X_PRIVATE_KEY); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -5448,7 +5572,7 @@ test_read_wifi_wpa_eap_ttls_tls (void) ASSERT (nm_connection_verify (connection, &error), "wifi-wpa-eap-ttls-tls-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wifi-wpa-eap-ttls-tls-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIFI_WPA_EAP_TTLS_TLS); /* ===== WIRELESS SETTING ===== */ @@ -5576,6 +5700,10 @@ test_read_wifi_wpa_eap_ttls_tls (void) NM_SETTING_802_1X_SETTING_NAME, NM_SETTING_802_1X_IDENTITY); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -5647,6 +5775,10 @@ test_read_wifi_dynamic_wep_leap (void) g_assert_cmpstr (nm_setting_802_1x_get_identity (s_8021x), ==, "bill smith"); g_assert_cmpstr (nm_setting_802_1x_get_password (s_8021x), ==, "foobar baz"); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -5688,7 +5820,7 @@ test_read_wifi_wep_eap_ttls_chap (void) ASSERT (nm_connection_verify (connection, &error), "wifi-wep-eap-ttls-chap-verify", "failed to verify %s: %s", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wifi-wep-eap-ttls-chap-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIFI_WEP_EAP_TTLS_CHAP); /* ===== WIRELESS SETTING ===== */ @@ -5808,6 +5940,10 @@ test_read_wifi_wep_eap_ttls_chap (void) NM_SETTING_802_1X_SETTING_NAME, NM_SETTING_802_1X_PASSWORD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -5850,7 +5986,7 @@ test_read_wired_qeth_static (void) ASSERT (nm_connection_verify (connection, &error), "wired-qeth-static-verify", "failed to verify %s: %s", TEST_IFCFG_WIRED_QETH_STATIC, error->message); - ASSERT (unmanaged == FALSE, + ASSERT (unmanaged == NULL, "wired-qeth-static-verify", "failed to verify %s: unexpected unmanaged value", TEST_IFCFG_WIRED_QETH_STATIC); /* ===== CONNECTION SETTING ===== */ @@ -5980,6 +6116,10 @@ test_read_wired_qeth_static (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -6020,7 +6160,7 @@ test_read_wired_ctc_static (void) success = nm_connection_verify (connection, &error); g_assert_no_error (error); g_assert (success); - g_assert (unmanaged == FALSE); + g_assert (unmanaged == NULL); /* ===== CONNECTION SETTING ===== */ s_con = nm_connection_get_setting_connection (connection); @@ -6049,6 +6189,10 @@ test_read_wired_ctc_static (void) g_assert (tmp != NULL); g_assert_cmpstr (tmp, ==, "0"); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -6172,6 +6316,10 @@ test_read_wifi_wep_no_keys (void) NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -6242,6 +6390,10 @@ test_read_permissions (void) ASSERT (strcmp (tmp, "johnny5") == 0, "permissions-verify-permissions", "unexpected permission #3"); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -6306,6 +6458,10 @@ test_read_wifi_wep_agent_keys (void) flags = nm_setting_wireless_security_get_wep_key_flags (s_wsec); g_assert (flags & NM_SETTING_SECRET_FLAG_AGENT_OWNED); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -6536,6 +6692,7 @@ test_write_wired_static (void) unlink (route6file); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -6654,6 +6811,10 @@ test_write_wired_dhcp (void) "wired-dhcp-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -6791,6 +6952,7 @@ test_write_wired_static_ip6_only (void) unlink (route6file); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -6935,6 +7097,7 @@ test_read_write_static_routes_legacy (void) "read-write-static-routes-legacy-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (keyfile2); g_free (routefile); @@ -7116,6 +7279,7 @@ test_write_wired_static_routes (void) "wired-static-routes-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -7257,6 +7421,10 @@ test_write_wired_dhcp_8021x_peap_mschapv2 (void) "wired-dhcp-8021x-peap-mschapv2write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7485,6 +7653,10 @@ test_write_wired_8021x_tls (NMSetting8021xCKScheme scheme, g_free (tmp); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7623,6 +7795,7 @@ test_write_wifi_open (void) ASSERT (strncmp (tmp, "\"\"", 2) != 0, "wifi-open-write-reread", "unexpected ESSID double-quote in %s", testfile); + g_free (tmp); svCloseFile (ifcfg); unlink (testfile); @@ -7637,6 +7810,10 @@ test_write_wifi_open (void) "wifi-open-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7756,6 +7933,10 @@ test_write_wifi_open_hex_ssid (void) "wifi-open-hex-ssid-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -7907,6 +8088,10 @@ test_write_wifi_wep (void) "wifi-wep-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8066,6 +8251,10 @@ test_write_wifi_wep_adhoc (void) "wifi-wep-adhoc-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8215,6 +8404,10 @@ test_write_wifi_wep_passphrase (void) "wifi-wep-passphrase-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8366,6 +8559,10 @@ test_write_wifi_wep_40_ascii (void) "wifi-wep-40-ascii-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8517,6 +8714,10 @@ test_write_wifi_wep_104_ascii (void) "wifi-wep-104-ascii-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8665,6 +8866,10 @@ test_write_wifi_leap (void) "wifi-leap-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8791,6 +8996,10 @@ test_write_wifi_leap_secret_flags (NMSettingSecretFlags flags) g_assert (nm_connection_compare (connection, reread, NM_SETTING_COMPARE_FLAG_EXACT)); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -8952,6 +9161,10 @@ test_write_wifi_wpa_psk (const char *name, test_name, "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9109,6 +9322,10 @@ test_write_wifi_wpa_psk_adhoc (void) "wifi-wpa-psk-adhoc-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9286,6 +9503,10 @@ test_write_wifi_wpa_eap_tls (void) "wifi-wpa-eap-tls-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9481,6 +9702,10 @@ test_write_wifi_wpa_eap_ttls_tls (void) "wifi-wpa-eap-ttls-tls-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9648,6 +9873,10 @@ test_write_wifi_wpa_eap_ttls_mschapv2 (void) "wifi-wpa-eap-ttls-mschapv2-write", "written and re-read connection weren't the same."); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9788,11 +10017,16 @@ test_write_wifi_dynamic_wep_leap (void) tmp = svGetValue (ifcfg, "IEEE_8021X_EAP_METHODS", FALSE); g_assert_cmpstr (tmp, ==, "LEAP"); + g_free (tmp); svCloseFile (ifcfg); unlink (testfile); g_free (testfile); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); g_object_unref (reread); } @@ -9929,6 +10163,10 @@ test_read_ibft_dhcp (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_METHOD); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -10141,6 +10379,10 @@ test_read_ibft_static (void) NM_SETTING_IP4_CONFIG_SETTING_NAME, NM_SETTING_IP4_CONFIG_ADDRESSES); + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); g_object_unref (connection); } @@ -10169,6 +10411,11 @@ test_read_ibft_malformed (const char *name, const char *iscsiadm_path) &ignore_error); ASSERT (connection == NULL, name, "unexpectedly able to read %s", TEST_IFCFG_IBFT_STATIC); + + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); } static void @@ -10298,6 +10545,7 @@ test_write_wired_qeth_dhcp (void) unlink (route6file); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -10391,10 +10639,12 @@ test_write_wired_ctc_dhcp (void) tmp = svGetValue (ifcfg, "CTCPROT", TRUE); g_assert (tmp); g_assert_cmpstr (tmp, ==, "0"); + g_free (tmp); /* And that it's not in the generic OPTIONS string */ tmp = svGetValue (ifcfg, "OPTIONS", TRUE); g_assert (tmp == NULL); + g_free (tmp); svCloseFile (ifcfg); @@ -10423,6 +10673,7 @@ test_write_wired_ctc_dhcp (void) unlink (route6file); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -10545,6 +10796,7 @@ test_write_permissions (void) unlink (route6file); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -10675,6 +10927,7 @@ test_write_wifi_wep_agent_keys (void) unlink (route6file); g_free (testfile); + g_free (unmanaged); g_free (keyfile); g_free (routefile); g_free (route6file); @@ -10969,6 +11222,11 @@ test_read_bridge_main (void) &ignore_error); ASSERT (connection == NULL, "bridge-main-read", "unexpected success reading %s", TEST_IFCFG_BRIDGE_MAIN); + + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); } #define TEST_IFCFG_BRIDGE_COMPONENT TEST_IFCFG_DIR"/network-scripts/ifcfg-test-bridge-component" @@ -11003,8 +11261,11 @@ test_read_bridge_component (void) ASSERT (g_strcmp0 (unmanaged, "mac:00:22:15:59:62:97") == 0, "bridge-component-read", "unexpected unmanaged spec from %s", TEST_IFCFG_BRIDGE_COMPONENT); - g_object_unref (connection); g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); + g_object_unref (connection); } #define TEST_IFCFG_VLAN_INTERFACE TEST_IFCFG_DIR"/network-scripts/ifcfg-test-vlan-interface" @@ -11032,6 +11293,11 @@ test_read_vlan_interface (void) &ignore_error); ASSERT (connection == NULL, "vlan-interface-read", "unexpected success reading %s", TEST_IFCFG_VLAN_INTERFACE); + + g_free (unmanaged); + g_free (keyfile); + g_free (routefile); + g_free (route6file); } #define TEST_IFCFG_WIFI_OPEN_SSID_BAD_HEX TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wifi-open-ssid-bad-hex"