]> granicus.if.org Git - neomutt/commitdiff
imap: Fix mx.mbox leak in imap_get_parent_path 808/head
authorJelle van der Waa <jelle@vdwaa.nl>
Sun, 1 Oct 2017 16:48:34 +0000 (18:48 +0200)
committerRichard Russon <rich@flatcap.org>
Mon, 2 Oct 2017 11:30:09 +0000 (12:30 +0100)
valgrind reports a memory leak in imap_get_parent_path due to no
free'ing mx.mbox. As described in imap_parse_path, the callee should
free mx.mbox.

imap/util.c

index 2945e8b376b9901c8c01d7455c4db05a155497ff..6d6acce3cbdce8c057b4fb6029d0887dec8edfb7 100644 (file)
@@ -166,6 +166,7 @@ void imap_get_parent_path(char *output, const char *path, size_t olen)
 
   /* Returns a fully qualified IMAP url */
   imap_qualify_path(output, olen, &mx, mbox);
+  FREE(&mx.mbox);
 }
 
 /**