From 68cb8c9a8ea8d254668cd00cc796a5f8a7755697 Mon Sep 17 00:00:00 2001 From: James Booth Date: Fri, 7 Apr 2017 00:08:54 +0100 Subject: [PATCH] Free cmd search index --- src/command/cmd_defs.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c index 9c320a4f..a5febc60 100644 --- a/src/command/cmd_defs.c +++ b/src/command/cmd_defs.c @@ -2298,6 +2298,7 @@ _cmd_index(Command *cmd) { } gchar **tokens = g_str_tokenize_and_fold(index_source->str, NULL, NULL); + g_string_free(index_source, TRUE); GString *index = g_string_new(""); i = 0; @@ -2305,6 +2306,7 @@ _cmd_index(Command *cmd) { index = g_string_append(index, tokens[i]); index = g_string_append(index, " "); } + g_strfreev(tokens); char *res = index->str; g_string_free(index, FALSE); @@ -2331,8 +2333,11 @@ cmd_search_index(char *term) } curr = g_list_next(curr); } + g_list_free(index_keys); } + g_strfreev(processed_terms); + return results; } @@ -2379,6 +2384,7 @@ void cmd_uninit(void) { cmd_ac_uninit(); + g_hash_table_destroy(search_index); } gboolean