diff options
author | Milan Crha <mcrha@redhat.com> | 2011-12-15 21:45:57 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-12-15 21:45:57 +0800 |
commit | a9cea92f5e356655013e20be8f1a94543c9ed72f (patch) | |
tree | 03115ef45e38b4c6ed442792ea75728e9949d3b6 /mail/em-config.c | |
parent | 09b17320afb38fc5550f28200935df242c29bf07 (diff) | |
download | gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar.gz gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.tar.zst gsoc2013-evolution-a9cea92f5e356655013e20be8f1a94543c9ed72f.zip |
Avoid use-after-free in em_config_target_update_settings
Diffstat (limited to 'mail/em-config.c')
-rw-r--r-- | mail/em-config.c | 6 |
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; |