aboutsummaryrefslogtreecommitdiff
path: root/lib/thread.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2011-01-25 23:40:35 +1000
committerCarl Worth <cworth@cworth.org>2011-01-26 15:59:19 +1000
commitb64afb1ab9924749cd6d3fbfa02e5e42bb0d728b (patch)
tree69eb4ee545074944d7171dbca0c709bec0bddf0c /lib/thread.cc
parent38ce0dbf82732590ef836767d3602db48ae345a9 (diff)
notmuch search: Clean up some memory leaks during search loop.
With talloc, we were already freeing all memory by the time we exited the loop, but that didn't help with excess use of memory inside the loop, (which was mostly from tallocing some objects with the incorrect parent). Thanks to Andrew Tridgell for sitting next to me and teaching me to use talloc_report_full to find these leaks.
Diffstat (limited to 'lib/thread.cc')
-rw-r--r--lib/thread.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/thread.cc b/lib/thread.cc
index b29f2c9..5190a66 100644
--- a/lib/thread.cc
+++ b/lib/thread.cc
@@ -397,7 +397,7 @@ _notmuch_thread_create (void *ctx,
notmuch_thread_t *thread;
notmuch_message_t *seed_message;
const char *thread_id;
- const char *thread_id_query_string;
+ char *thread_id_query_string;
notmuch_query_t *thread_id_query;
notmuch_messages_t *messages;
@@ -416,6 +416,8 @@ _notmuch_thread_create (void *ctx,
if (unlikely (thread_id_query == NULL))
return NULL;
+ talloc_free (thread_id_query_string);
+
thread = talloc (ctx, notmuch_thread_t);
if (unlikely (thread == NULL))
return NULL;