[PATCH 2/3] Fix memory leak in guess_from_received_header().

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Wed Jun 15 04:12:13 PDT 2011


Mta variable was not free()d in one case.
---
 notmuch-reply.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index dab69e6..64f70bf 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -401,8 +401,10 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message
 	    break;
 	mta = xstrdup (by);
 	token = strtok(mta," \t");
-	if (token == NULL)
+	if (token == NULL) {
+	    free (mta);
 	    break;
+	}
 	/* Now extract the last two components of the MTA host name
 	 * as domain and tld.
 	 */
-- 
1.7.5.4



More information about the notmuch mailing list