[balsa] imap-mbox-handle: Do not leak a GNode tree



commit 38561e6c83796d53395a959443dce1218177fe48
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Feb 16 11:59:06 2019 -0500

    imap-mbox-handle: Do not leak a GNode tree
    
    * libbalsa/imap/imap-handle.c (imap_mbox_handle_finalize):
    destroy the thread-root GNode tree.

 ChangeLog                   | 7 +++++++
 libbalsa/imap/imap-handle.c | 5 +++++
 2 files changed, 12 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index e4a021f5c..6a9feda19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-02-16  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       imap-mbox-handle: Do not leak a GNode tree
+
+       * libbalsa/imap/imap-handle.c (imap_mbox_handle_finalize):
+       destroy the thread-root GNode tree.
+
 2018-02-15  Albrecht Dreß  <albrecht dress arcor de>
 
        Relax secret key selection
diff --git a/libbalsa/imap/imap-handle.c b/libbalsa/imap/imap-handle.c
index e8b950f30..317d803cc 100644
--- a/libbalsa/imap/imap-handle.c
+++ b/libbalsa/imap/imap-handle.c
@@ -935,6 +935,11 @@ imap_mbox_handle_finalize(GObject* gobject)
   g_list_free(handle->cmd_info); handle->cmd_info = NULL;
   g_hash_table_destroy(handle->status_resps); handle->status_resps = NULL;
 
+  if (handle->thread_root != NULL) {
+      g_node_destroy(handle->thread_root);
+      handle->thread_root = NULL;
+  }
+
   mbox_view_dispose(&handle->mbox_view);
   imap_mbox_resize_cache(handle, 0);
   g_free(handle->msg_cache); handle->msg_cache = NULL;


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