From 232bb3cea28db108e25932c4519ee2b2f32168c3 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 26 May 2011 19:43:19 -0500 Subject: [PATCH] settings: suppress warnings about NULL hash tables --- src/settings/nm-settings-connection.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/settings/nm-settings-connection.c b/src/settings/nm-settings-connection.c index 9207909320..60de6b0684 100644 --- a/src/settings/nm-settings-connection.c +++ b/src/settings/nm-settings-connection.c @@ -320,7 +320,8 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self, * should not. Thus we preserve non-system-owned secrets here. */ transient_secrets = nm_connection_to_hash (NM_CONNECTION (self), NM_SETTING_HASH_FLAG_ONLY_SECRETS); - for_each_secret (NM_CONNECTION (self), transient_secrets, clear_system_secrets, NULL); + if (transient_secrets) + for_each_secret (NM_CONNECTION (self), transient_secrets, clear_system_secrets, NULL); new_settings = nm_connection_to_hash (new, NM_SETTING_HASH_FLAG_ALL); g_assert (new_settings); @@ -349,7 +350,8 @@ nm_settings_connection_replace_settings (NMSettingsConnection *self, success = TRUE; } g_hash_table_destroy (new_settings); - g_hash_table_destroy (transient_secrets); + if (transient_secrets) + g_hash_table_destroy (transient_secrets); return success; }