From c59848b1830dee008bd766d2665db0781c6aabc3 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Mon, 9 Jul 2012 12:35:01 +0200 Subject: [PATCH] McdAccountManagerDefault: Fix a possible double free If the account is already in the hashtable, g_hash_table_insert() will set @removed as value, but free it since the key already in the table is kept. https://bugs.freedesktop.org/show_bug.cgi?id=51842 --- src/mcd-account-manager-default.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mcd-account-manager-default.c b/src/mcd-account-manager-default.c index deae163..e156de1 100644 --- a/src/mcd-account-manager-default.c +++ b/src/mcd-account-manager-default.c @@ -77,7 +77,7 @@ _delete_from_keyring (const McpAccountStorage *self, { /* flag the whole account as purged */ gchar *removed = g_strdup (account); - g_hash_table_insert (amd->removed_accounts, removed, removed); + g_hash_table_replace (amd->removed_accounts, removed, removed); } else { -- 1.7.9.5