From 77195ccb88aab66a5d138ca1e09324e482f897ac Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 25 Oct 2020 14:07:58 -0700 Subject: [PATCH] cleanup: fix resource leak And address typo in comment. Fixes CID 362915 Signed-off-by: Dirk Hohndel --- core/save-git.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/save-git.c b/core/save-git.c index e875d2fb4..bdc08fef6 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -957,7 +957,7 @@ static void format_one_filter_constraint(int preset_id, int constraint_id, struc /* * Write a filter constraint to the membuffer b. * Each line starts with a type, which is either "name", "fulltext" or "constraint". - * There must be one "name" entry, zero or ont "fulltext" entries and an arbitrary number of "contraint" entries. + * There must be one "name" entry, zero or one "fulltext" entries and an arbitrary number of "contraint" entries. * The "name" entry gives the name of the filter constraint. * The "fulltext" entry has the format * fulltext mode "fulltext mode" query "the query as entered by the user" @@ -976,6 +976,7 @@ static void format_one_filter_preset(int preset_id, struct membuffer *b) show_utf8(b, "fulltext mode=", filter_preset_fulltext_mode(preset_id), ""); show_utf8(b, " query=", fulltext, "\n"); } + free(fulltext); for (int i = 0; i < filter_preset_constraint_count(preset_id); i++) format_one_filter_constraint(preset_id, i, b);