aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-search.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-folder-search.c')
-rw-r--r--camel/camel-folder-search.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index f19ec19aa3..89fb8f1db0 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -361,8 +361,7 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
matches = g_ptr_array_new();
/* now create a folder summary to return?? */
- if (r
- && r->type == ESEXP_RES_ARRAY_PTR) {
+ if (r->type == ESEXP_RES_ARRAY_PTR) {
d(printf("got result ...\n"));
/* we use a mempool to store the strings, packed in tight as possible, and freed together */
/* because the strings are often short (like <8 bytes long), we would be wasting appx 50%
@@ -390,15 +389,16 @@ camel_folder_search_execute_expression(CamelFolderSearch *search, const char *ex
g_ptr_array_add(matches, e_mempool_strdup(pool, g_ptr_array_index(r->value.ptrarray, i)));
}
}
- e_sexp_result_free(search->sexp, r);
/* instead of putting the mempool_hash in the structure, we keep the api clean by
putting a reference to it in a hashtable. Lets us do some debugging and catch
unfree'd results as well. */
g_hash_table_insert(p->mempool_hash, matches, pool);
} else {
- d(printf("no result!\n"));
+ g_warning("Search returned an invalid result type");
}
+ e_sexp_result_free(search->sexp, r);
+
search->folder = NULL;
search->summary = NULL;
search->current = NULL;