libnm-util: don't return empty hashes from nm_setting_to_hash()

This commit is contained in:
Dan Williams
2011-02-07 13:44:28 -06:00
parent 899b8a40dc
commit ad56cfa914

View File

@@ -162,8 +162,14 @@ nm_setting_to_hash (NMSetting *setting, NMSettingHashFlags flags)
else
destroy_gvalue (value);
}
g_free (property_specs);
/* Don't return empty hashes */
if (g_hash_table_size (hash) < 1) {
g_hash_table_destroy (hash);
hash = NULL;
}
return hash;
}