[gnc-gsettings.cpp] plug a char* leak

full_name leaks if it's already in schema_hash hash table. It would be
better to convert GHashTable to unordered_map.
This commit is contained in:
Christopher Lam 2023-06-19 23:47:14 +08:00
parent 16640be62f
commit b331ec974e

View File

@ -135,10 +135,11 @@ gnc_gsettings_register_cb (const gchar *schema, const gchar *key,
{
gs_obj = gnc_gsettings_get_settings_obj (schema);
if (G_IS_SETTINGS (gs_obj))
g_hash_table_insert (schema_hash, full_name, gs_obj);
g_hash_table_insert (schema_hash, g_strdup (full_name), gs_obj);
else
PWARN ("Ignoring attempt to access unknown gsettings schema %s", full_name);
}
g_free (full_name);
g_return_val_if_fail (G_IS_SETTINGS (gs_obj), 0);
auto signal = static_cast<char *> (nullptr);