aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-12-15 21:45:57 +0800
committerMilan Crha <mcrha@redhat.com>2011-12-15 21:45:57 +0800
commita9cea92f5e356655013e20be8f1a94543c9ed72f (patch)
tree03115ef45e38b4c6ed442792ea75728e9949d3b6 /mail
parent09b17320afb38fc5550f28200935df242c29bf07 (diff)
downloadgsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar
gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar.gz
gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar.bz2
gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar.lz
gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar.xz
gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar.zst
gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.zip
Avoid use-after-free in em_config_target_update_settings
Diffstat (limited to 'mail')
-rw-r--r--mail/em-config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mail/em-config.c b/mail/em-config.c
index 1e025323f4..fbf27fa1bb 100644
--- a/mail/em-config.c
+++ b/mail/em-config.c
@@ -207,6 +207,8 @@ em_config_target_update_settings (EConfig *ep,
const gchar *transport_protocol,
CamelSettings *transport_settings)
{
+ gchar *tmp;
+
g_return_if_fail (ep != NULL);
g_return_if_fail (target != NULL);
@@ -228,8 +230,10 @@ em_config_target_update_settings (EConfig *ep,
if (target->transport_settings != NULL)
g_object_unref (target->transport_settings);
+ /* the pointers can be same, thus avoid use-after-free */
+ tmp = g_strdup (email_address);
g_free (target->email_address);
- target->email_address = g_strdup (email_address);
+ target->email_address = tmp;
target->storage_protocol = storage_protocol;
target->storage_settings = storage_settings;