[PATCH] lib: fix memory leak of field processor objects

Subject: [PATCH] lib: fix memory leak of field processor objects

Date: Thu, 9 Jun 2016 23:37:48 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


The field processor objects need to be deallocated explicitly just like
the range processors (or a talloc destructor defined).
---
 lib/database.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/database.cc b/lib/database.cc
index 2b2d821..afafe88 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1107,6 +1107,13 @@ notmuch_database_close (notmuch_database_t *notmuch)
     delete notmuch->last_mod_range_processor;
     notmuch->last_mod_range_processor = NULL;
 
+#if HAVE_XAPIAN_FIELD_PROCESSOR
+    delete notmuch->date_field_processor;
+    notmuch->date_field_processor = NULL;
+    delete notmuch->query_field_processor;
+    notmuch->query_field_processor = NULL;
+#endif
+
     return status;
 }
 
-- 
2.8.1


Thread: