diff --git a/libnm-core/nm-connection.c b/libnm-core/nm-connection.c index 724e8557b8..b2c109f874 100644 --- a/libnm-core/nm-connection.c +++ b/libnm-core/nm-connection.c @@ -674,8 +674,10 @@ _nm_connection_find_base_type_setting (NMConnection *connection) { NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (connection); GHashTableIter iter; - NMSetting *setting = NULL, *s_iter; - NMSettingPriority setting_prio, s_iter_prio; + NMSetting *setting = NULL; + NMSetting *s_iter; + NMSettingPriority setting_prio = NM_SETTING_PRIORITY_USER; + NMSettingPriority s_iter_prio; g_hash_table_iter_init (&iter, priv->settings); while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &s_iter)) { diff --git a/libnm-core/nm-setting-sriov.c b/libnm-core/nm-setting-sriov.c index 068d218574..9c7306e011 100644 --- a/libnm-core/nm-setting-sriov.c +++ b/libnm-core/nm-setting-sriov.c @@ -919,7 +919,7 @@ vfs_to_dbus (NMSetting *setting, const char *property) GVariantBuilder vf_builder; const guint *vlan_ids; const char **name; - guint num_vlans; + guint num_vlans = 0; g_variant_builder_init (&vf_builder, G_VARIANT_TYPE_VARDICT); g_variant_builder_add (&vf_builder, "{sv}", "index", diff --git a/shared/systemd/src/basic/hashmap.c b/shared/systemd/src/basic/hashmap.c index 09303c6f63..9c3a6d5a46 100644 --- a/shared/systemd/src/basic/hashmap.c +++ b/shared/systemd/src/basic/hashmap.c @@ -890,7 +890,8 @@ void internal_hashmap_clear(HashmapBase *h, free_func_t default_free_key, free_f * themselves from our hash table a second time, the entry is already gone. */ while (internal_hashmap_size(h) > 0) { - void *v, *k; + void *k = NULL; + void *v; v = internal_hashmap_first_key_and_value(h, true, &k); diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index c2396d77c8..cdaaf9186f 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -5643,7 +5643,6 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError ** NMDeviceClass *klass; const char *const *patterns; NMSettingMatch *s_match; - guint num_patterns; klass = NM_DEVICE_GET_CLASS (self); if (klass->connection_type_check_compatible) { @@ -5684,6 +5683,8 @@ check_connection_compatible (NMDevice *self, NMConnection *connection, GError ** s_match = (NMSettingMatch *) nm_connection_get_setting (connection, NM_TYPE_SETTING_MATCH); if (s_match) { + guint num_patterns = 0; + patterns = nm_setting_match_get_interface_names (s_match, &num_patterns); if (!nm_wildcard_match_check (device_iface, patterns, num_patterns)) { nm_utils_error_set_literal (error, NM_UTILS_ERROR_CONNECTION_AVAILABLE_TEMPORARY, diff --git a/src/nm-ip4-config.c b/src/nm-ip4-config.c index 1179a77ffa..259c922020 100644 --- a/src/nm-ip4-config.c +++ b/src/nm-ip4-config.c @@ -2153,7 +2153,7 @@ nm_ip4_config_get_first_address (const NMIP4Config *self) const NMPlatformIP4Address * _nmtst_ip4_config_get_address (const NMIP4Config *self, guint i) { - NMDedupMultiIter iter; + NMDedupMultiIter iter = { }; const NMPlatformIP4Address *a = NULL; guint j;