From ded32d92d7db5fc85f3276462edae4c00547fad4 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 1 Sep 2010 15:12:15 +0200 Subject: [PATCH] Bug #628485 - Accessing freed memory in EContactStore::dispose --- libedataserverui/e-contact-store.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libedataserverui/e-contact-store.c b/libedataserverui/e-contact-store.c index 21fd677..de98248 100644 --- a/libedataserverui/e-contact-store.c +++ b/libedataserverui/e-contact-store.c @@ -112,8 +112,9 @@ contact_store_dispose (GObject *object) for (ii = 0; ii < priv->contact_sources->len; ii++) { ContactSource *source; + /* clear from back, because clear_contact_source can later access freed memory */ source = &g_array_index ( - priv->contact_sources, ContactSource, ii); + priv->contact_sources, ContactSource, priv->contact_sources->len - ii - 1); clear_contact_source (E_CONTACT_STORE (object), source); free_contact_ptrarray (source->contacts); -- 2.7.4