[evolution-ews] Fix few memory leaks



commit edff1fec6eb78738e6ef7fc5bc91a78457d49c16
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 9 15:08:12 2017 +0100

    Fix few memory leaks

 src/camel/camel-ews-folder.c    |    6 +++++-
 src/server/camel-ews-settings.c |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index d4425b1..f1a0f53 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -1925,12 +1925,16 @@ ews_refresh_info_sync (CamelFolder *folder,
        do {
                GSList *items_created = NULL, *items_updated = NULL;
                GSList *items_deleted = NULL;
+               gchar *new_sync_state = NULL;
                guint32 total, unread;
 
                e_ews_connection_sync_folder_items_sync (cnc, EWS_PRIORITY_MEDIUM, sync_state, id, "IdOnly", 
NULL, EWS_MAX_FETCH_COUNT,
-                       &sync_state, &includes_last_item, &items_created, &items_updated, &items_deleted,
+                       &new_sync_state, &includes_last_item, &items_created, &items_updated, &items_deleted,
                        cancellable, &local_error);
 
+               g_free (sync_state);
+               sync_state = new_sync_state;
+
                if (g_error_matches (local_error, EWS_CONNECTION_ERROR, 
EWS_CONNECTION_ERROR_INVALIDSYNCSTATEDATA)) {
                        g_clear_error (&local_error);
                        camel_ews_summary_set_sync_state (CAMEL_EWS_SUMMARY (folder_summary), NULL);
diff --git a/src/server/camel-ews-settings.c b/src/server/camel-ews-settings.c
index bee5f6b..58bbc6b 100644
--- a/src/server/camel-ews-settings.c
+++ b/src/server/camel-ews-settings.c
@@ -402,6 +402,7 @@ ews_settings_finalize (GObject *object)
        g_free (priv->oaburl);
        g_free (priv->oal_selected);
        g_free (priv->impersonate_user);
+       g_free (priv->user_agent);
 
        /* Chain up to parent's finalize() method. */
        G_OBJECT_CLASS (camel_ews_settings_parent_class)->finalize (object);


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