aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2017-04-07 00:08:54 +0100
committerJames Booth <boothj5@gmail.com>2017-04-07 00:08:54 +0100
commit68cb8c9a8ea8d254668cd00cc796a5f8a7755697 (patch)
tree7d53ee85fc2703de8b39bd4d69c9206d3703839f /src
parentfd6620a950ebac0794a5eddbc38ce13b6bfc00ae (diff)
downloadprofani-tty-68cb8c9a8ea8d254668cd00cc796a5f8a7755697.tar.gz
Free cmd search index
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_defs.c6
1 files changed, 6 insertions, 0 deletions
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