diff --git a/libnm-core/tests/test-crypto.c b/libnm-core/tests/test-crypto.c index b6ed2b11a..e4ca80865 100644 --- a/libnm-core/tests/test-crypto.c +++ b/libnm-core/tests/test-crypto.c @@ -98,7 +98,7 @@ out: static void test_cert (gconstpointer test_data) { - gs_free char *path; + gs_free char *path = NULL; GByteArray *array; NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; GError *error = NULL; diff --git a/libnm-core/tests/test-general.c b/libnm-core/tests/test-general.c index 2a091187a..7df4e57aa 100644 --- a/libnm-core/tests/test-general.c +++ b/libnm-core/tests/test-general.c @@ -649,7 +649,7 @@ test_setting_ip4_config_address_data (void) static void test_setting_gsm_apn_spaces (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; const char *tmp; s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); @@ -677,7 +677,7 @@ test_setting_gsm_apn_spaces (void) static void test_setting_gsm_apn_bad_chars (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); ASSERT (s_gsm != NULL, @@ -715,7 +715,7 @@ test_setting_gsm_apn_bad_chars (void) static void test_setting_gsm_apn_underscore (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); g_assert (s_gsm); @@ -730,7 +730,7 @@ test_setting_gsm_apn_underscore (void) static void test_setting_gsm_without_number (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); g_assert (s_gsm); @@ -2390,7 +2390,7 @@ test_connection_bad_base_types (void) static void test_setting_compare_id (void) { - gs_unref_object NMSetting *old, *new; + gs_unref_object NMSetting *old = NULL, *new = NULL; gboolean success; old = nm_setting_connection_new (); @@ -2414,7 +2414,7 @@ test_setting_compare_id (void) static void test_setting_compare_timestamp (void) { - gs_unref_object NMSetting *old, *new; + gs_unref_object NMSetting *old = NULL, *new = NULL; gboolean success; old = nm_setting_connection_new (); @@ -2459,7 +2459,7 @@ static void test_setting_compare_secrets (gconstpointer test_data) { const TestDataCompareSecrets *data = test_data; - gs_unref_object NMSetting *old, *new; + gs_unref_object NMSetting *old = NULL, *new = NULL; gboolean success; /* Make sure that a connection with transient/unsaved secrets compares @@ -2490,7 +2490,7 @@ static void test_setting_compare_vpn_secrets (gconstpointer test_data) { const TestDataCompareSecrets *data = test_data; - gs_unref_object NMSetting *old, *new; + gs_unref_object NMSetting *old = NULL, *new = NULL; gboolean success; /* Make sure that a connection with transient/unsaved secrets compares @@ -2766,7 +2766,7 @@ test_setting_connection_changed_signal (void) NMConnection *connection; gboolean changed = FALSE; NMSettingConnection *s_con; - gs_free char *uuid; + gs_free char *uuid = NULL; connection = nm_simple_connection_new (); g_signal_connect (connection, @@ -3172,7 +3172,7 @@ test_setting_802_1x_changed_signal (void) static void test_setting_old_uuid (void) { - gs_unref_object NMSetting *setting; + gs_unref_object NMSetting *setting = NULL; /* NetworkManager-0.9.4.0 generated 40-character UUIDs with no dashes, * like this one. Test that we maintain compatibility. */ diff --git a/libnm-core/tests/test-setting-dcb.c b/libnm-core/tests/test-setting-dcb.c index 2265db890..f7554e81a 100644 --- a/libnm-core/tests/test-setting-dcb.c +++ b/libnm-core/tests/test-setting-dcb.c @@ -37,7 +37,7 @@ static void test_dcb_flags_valid (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; guint i; @@ -90,7 +90,7 @@ test_dcb_flags_valid (void) static void test_dcb_flags_invalid (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; @@ -149,7 +149,7 @@ test_dcb_flags_invalid (void) static void test_dcb_app_priorities (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; @@ -211,7 +211,7 @@ test_dcb_app_priorities (void) static void test_dcb_priorities_valid (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; guint i; @@ -270,7 +270,7 @@ test_dcb_priorities_valid (void) static void test_dcb_bandwidth_sums (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; diff --git a/libnm-util/tests/test-crypto.c b/libnm-util/tests/test-crypto.c index 960316d56..8055facf0 100644 --- a/libnm-util/tests/test-crypto.c +++ b/libnm-util/tests/test-crypto.c @@ -96,7 +96,7 @@ out: static void test_cert (gconstpointer test_data) { - gs_free char *path; + gs_free char *path = NULL; GByteArray *array; NMCryptoFileFormat format = NM_CRYPTO_FILE_FORMAT_UNKNOWN; GError *error = NULL; diff --git a/libnm-util/tests/test-general.c b/libnm-util/tests/test-general.c index 52508115f..d8f9dcc4a 100644 --- a/libnm-util/tests/test-general.c +++ b/libnm-util/tests/test-general.c @@ -415,7 +415,7 @@ test_setting_ip6_config_old_address_array (void) static void test_setting_gsm_apn_spaces (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; const char *tmp; s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); @@ -443,7 +443,7 @@ test_setting_gsm_apn_spaces (void) static void test_setting_gsm_apn_bad_chars (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; s_gsm = (NMSettingGsm *) nm_setting_gsm_new (); ASSERT (s_gsm != NULL, @@ -481,7 +481,7 @@ test_setting_gsm_apn_bad_chars (void) static void test_setting_gsm_apn_underscore (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; GError *error = NULL; gboolean success; @@ -500,7 +500,7 @@ test_setting_gsm_apn_underscore (void) static void test_setting_gsm_without_number (void) { - gs_unref_object NMSettingGsm *s_gsm; + gs_unref_object NMSettingGsm *s_gsm = NULL; GError *error = NULL; gboolean success; @@ -1681,7 +1681,7 @@ test_connection_bad_base_types (void) static void test_setting_compare_id (void) { - gs_unref_object NMSetting *old, *new; + gs_unref_object NMSetting *old = NULL, *new = NULL; gboolean success; old = nm_setting_connection_new (); @@ -1707,7 +1707,7 @@ test_setting_compare_secrets (NMSettingSecretFlags secret_flags, NMSettingCompareFlags comp_flags, gboolean remove_secret) { - gs_unref_object NMSetting *old, *new; + gs_unref_object NMSetting *old = NULL, *new = NULL; gboolean success; /* Make sure that a connection with transient/unsaved secrets compares @@ -1739,7 +1739,7 @@ test_setting_compare_vpn_secrets (NMSettingSecretFlags secret_flags, NMSettingCompareFlags comp_flags, gboolean remove_secret) { - gs_unref_object NMSetting *old, *new; + gs_unref_object NMSetting *old = NULL, *new = NULL; gboolean success; /* Make sure that a connection with transient/unsaved secrets compares @@ -1918,7 +1918,7 @@ test_setting_connection_changed_signal (void) NMConnection *connection; gboolean changed = FALSE; NMSettingConnection *s_con; - gs_free char *uuid; + gs_free char *uuid = NULL; connection = nm_connection_new (); g_signal_connect (connection, @@ -2328,7 +2328,7 @@ static void test_setting_old_uuid (void) { GError *error = NULL; - gs_unref_object NMSetting *setting; + gs_unref_object NMSetting *setting = NULL; gboolean success; /* NetworkManager-0.9.4.0 generated 40-character UUIDs with no dashes, diff --git a/libnm-util/tests/test-setting-dcb.c b/libnm-util/tests/test-setting-dcb.c index c40ef54ad..36192cd33 100644 --- a/libnm-util/tests/test-setting-dcb.c +++ b/libnm-util/tests/test-setting-dcb.c @@ -35,7 +35,7 @@ static void test_dcb_flags_valid (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; guint i; @@ -88,7 +88,7 @@ test_dcb_flags_valid (void) static void test_dcb_flags_invalid (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; @@ -147,7 +147,7 @@ test_dcb_flags_invalid (void) static void test_dcb_app_priorities (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; @@ -209,7 +209,7 @@ test_dcb_app_priorities (void) static void test_dcb_priorities_valid (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; guint i; @@ -268,7 +268,7 @@ test_dcb_priorities_valid (void) static void test_dcb_bandwidth_sums (void) { - gs_unref_object NMSettingDcb *s_dcb; + gs_unref_object NMSettingDcb *s_dcb = NULL; GError *error = NULL; gboolean success; diff --git a/libnm/tests/test-secret-agent.c b/libnm/tests/test-secret-agent.c index dc1b9d683..037b5a813 100644 --- a/libnm/tests/test-secret-agent.c +++ b/libnm/tests/test-secret-agent.c @@ -434,7 +434,7 @@ connection_activated_cancel_cb (GObject *c, gpointer user_data) { TestSecretAgentData *sadata = user_data; - gs_unref_object NMActiveConnection *ac; + gs_unref_object NMActiveConnection *ac = NULL; gs_free_error GError *error = NULL; ac = nm_client_activate_connection_finish (sadata->client, result, &error); diff --git a/src/supplicant-manager/tests/test-supplicant-config.c b/src/supplicant-manager/tests/test-supplicant-config.c index 9b9e392d2..5ffead40d 100644 --- a/src/supplicant-manager/tests/test-supplicant-config.c +++ b/src/supplicant-manager/tests/test-supplicant-config.c @@ -111,7 +111,7 @@ test_wifi_open (void) NMSettingConnection *s_con; NMSettingWireless *s_wifi; NMSettingIPConfig *s_ip4; - gs_unref_object NMSupplicantConfig *config; + gs_unref_object NMSupplicantConfig *config = NULL; GHashTable *hash; char *uuid; gboolean success; @@ -207,7 +207,7 @@ test_wifi_wep_key (const char *detail, NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - gs_unref_object NMSupplicantConfig *config; + gs_unref_object NMSupplicantConfig *config = NULL; GHashTable *hash; char *uuid; gboolean success; @@ -345,7 +345,7 @@ test_wifi_wpa_psk (const char *detail, NMSettingWireless *s_wifi; NMSettingWirelessSecurity *s_wsec; NMSettingIPConfig *s_ip4; - gs_unref_object NMSupplicantConfig *config; + gs_unref_object NMSupplicantConfig *config = NULL; GHashTable *hash; char *uuid; gboolean success; diff --git a/src/tests/test-wired-defname.c b/src/tests/test-wired-defname.c index 1d83f3d1a..b2933de0e 100644 --- a/src/tests/test-wired-defname.c +++ b/src/tests/test-wired-defname.c @@ -46,7 +46,7 @@ _new_connection (const char *id) static void test_defname_no_connections (void) { - gs_free char *name; + gs_free char *name = NULL; name = nm_device_ethernet_utils_get_default_wired_name (NULL); g_assert_cmpstr (name, ==, "Wired connection 1"); @@ -58,7 +58,7 @@ static void test_defname_no_conflict (void) { GSList *list = NULL; - gs_free char *name; + gs_free char *name = NULL; list = g_slist_append (list, _new_connection ("asdfasdfasdfadf")); list = g_slist_append (list, _new_connection ("work wifi")); @@ -76,7 +76,7 @@ static void test_defname_conflict (void) { GSList *list = NULL; - gs_free char *name; + gs_free char *name = NULL; list = g_slist_append (list, _new_connection ("asdfasdfasdfadf")); list = g_slist_append (list, _new_connection ("Wired connection 1")); @@ -94,7 +94,7 @@ static void test_defname_multiple_conflicts (void) { GSList *list = NULL; - gs_free char *name; + gs_free char *name = NULL; list = g_slist_append (list, _new_connection ("random gsm connection")); list = g_slist_append (list, _new_connection ("home wifi"));