[evolution-ews] Fix two memory leaks from Camel code



commit 980d8e182793c1dd5782944411370cb0fa1a2747
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 26 16:53:39 2014 +0100

    Fix two memory leaks from Camel code
    
    There were rewrote possibly already set property values unconditionally,
    effectively leaking the previously stored values there.

 src/camel/camel-ews-summary.c |    2 ++
 src/camel/camel-ews-utils.c   |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/camel/camel-ews-summary.c b/src/camel/camel-ews-summary.c
index e413910..971e902 100644
--- a/src/camel/camel-ews-summary.c
+++ b/src/camel/camel-ews-summary.c
@@ -255,9 +255,11 @@ content_info_to_db (CamelFolderSummary *s,
 {
 
        if (info->type) {
+               g_free (mir->cinfo);
                mir->cinfo = g_strdup ("1");
                return CAMEL_FOLDER_SUMMARY_CLASS (camel_ews_summary_parent_class)->content_info_to_db (s, 
info, mir);
        } else {
+               g_free (mir->cinfo);
                mir->cinfo = g_strdup ("0");
                return TRUE;
        }
diff --git a/src/camel/camel-ews-utils.c b/src/camel/camel-ews-utils.c
index 9d5aeb0..87e9eab 100644
--- a/src/camel/camel-ews-utils.c
+++ b/src/camel/camel-ews-utils.c
@@ -620,6 +620,8 @@ ews_set_threading_data (CamelEwsMessageInfo *mi,
                return;
 
        count = camel_header_references_list_size (&refs);
+       g_free (mi->info.references);
+       mi->info.references = NULL;
        mi->info.references = g_malloc (
                sizeof (*mi->info.references) + ((count - 1) *
                sizeof (mi->info.references->references[0])));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]