[neomutt-devel] [PATCH] fix memory leak in alias_complete()

Meindert Kempe mail at mkempe.com
Thu Dec 14 01:16:02 CET 2023


---
Hi,

I saw asan warn me about a memory leak. There appears to be a free
missing before this return statement in alias_complete().

Regards,
Meindert

 alias/dlg_alias.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/alias/dlg_alias.c b/alias/dlg_alias.c
index 2747d4c76..8d08200d8 100644
--- a/alias/dlg_alias.c
+++ b/alias/dlg_alias.c
@@ -444,6 +444,7 @@ int alias_complete(struct Buffer *buf, struct ConfigSubset *sub)
         /* we are adding something to the completion */
         buf_strcpy_n(buf, bestname, mutt_str_len(bestname) + 1);
         FREE(&mdata.limit);
+        search_state_free(&mdata.search_state);
         return 1;
       }
 
-- 
2.43.0



More information about the neomutt-devel mailing list