From 5a390e6402df65a6c19570766005efbbb1f9a6da Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Mon, 10 Jul 2006 17:56:27 +0000 Subject: [PATCH] Avoid dangling pointers after call to free. SVN revision: 23816 --- e_mod_config.c | 1 + e_mod_main.c | 4 ++++ imap.c | 2 +- mbox.c | 2 ++ mdir.c | 2 ++ pop.c | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/e_mod_config.c b/e_mod_config.c index d451ca7..6e51aa1 100644 --- a/e_mod_config.c +++ b/e_mod_config.c @@ -73,6 +73,7 @@ _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) if (!mail_config) return; mail_config->config_dialog = NULL; free(cfdata); + cfdata = NULL; } static Evas_Object * diff --git a/e_mod_main.c b/e_mod_main.c index 9bd62f6..261555e 100644 --- a/e_mod_main.c +++ b/e_mod_main.c @@ -143,6 +143,7 @@ _gc_shutdown(E_Gadcon_Client *gcc) mail_config->instances = evas_list_remove(mail_config->instances, inst); _mail_free(inst->mail); free(inst); + inst = NULL; } static void @@ -415,10 +416,12 @@ e_modapi_shutdown(E_Module *m) if (cb->exec) evas_stringshare_del(cb->exec); ci->boxes = evas_list_remove_list(ci->boxes, ci->boxes); free(cb); + cb = NULL; } if (ci->id) evas_stringshare_del(ci->id); mail_config->items = evas_list_remove_list(mail_config->items, mail_config->items); free(ci); + ci = NULL; } _mail_imap_shutdown(); _mail_pop_shutdown(); @@ -481,6 +484,7 @@ _mail_free(Mail *mail) { evas_object_del(mail->mail_obj); free(mail); + mail = NULL; } static int diff --git a/imap.c b/imap.c index 68fd4cf..ef198f1 100644 --- a/imap.c +++ b/imap.c @@ -78,7 +78,6 @@ _mail_imap_del_mailbox(void *data) void _mail_imap_shutdown() { - if (!iservers) return; while (iservers) { @@ -93,6 +92,7 @@ _mail_imap_shutdown() ecore_event_handler_del(is->data_handler); iservers = evas_list_remove_list(iservers, iservers); free(is); + is = NULL; } } diff --git a/mbox.c b/mbox.c index d367e96..e2307d3 100644 --- a/mbox.c +++ b/mbox.c @@ -44,6 +44,7 @@ _mail_mbox_del_mailbox(void *data) ecore_file_monitor_del(mb->monitor); mboxes = evas_list_remove(mboxes, mb); free(mb); + mb = NULL; break; } } @@ -61,6 +62,7 @@ _mail_mbox_shutdown() ecore_file_monitor_del(mb->monitor); mboxes = evas_list_remove_list(mboxes, mboxes); free(mb); + mb = NULL; } } diff --git a/mdir.c b/mdir.c index 7a811b7..68db300 100644 --- a/mdir.c +++ b/mdir.c @@ -43,6 +43,7 @@ _mail_mdir_del_mailbox(void *data) if (mc->config != cb) continue; mdirs = evas_list_remove(mdirs, mc); free(mc); + mc = NULL; break; } } @@ -60,6 +61,7 @@ _mail_mdir_shutdown() ecore_file_monitor_del(mc->monitor); mdirs = evas_list_remove_list(mdirs, mdirs); free(mc); + mc = NULL; } } diff --git a/pop.c b/pop.c index 34b09ec..9b2f61d 100644 --- a/pop.c +++ b/pop.c @@ -101,6 +101,7 @@ _mail_pop_shutdown() ecore_event_handler_del(pc->data_handler); pclients = evas_list_remove_list(pclients, pclients); free(pc); + pc = NULL; } }