Fix memory leak in guess_from_received_header().
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Wed, 15 Jun 2011 11:12:13 +0000 (15:12 +0400)
committerCarl Worth <cworth@cworth.org>
Wed, 15 Jun 2011 14:08:25 +0000 (07:08 -0700)
Mta variable was not free()d in one case.

notmuch-reply.c

index dab69e664b6ee2f949b48106c15c8ea0dfd09e36..64f70bf74256fe317df62181212531cd36e91e7d 100644 (file)
@@ -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.
         */