X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=27ef37bd914cd0af1da57f8dd60bf33f1509cfce;hp=dab69e664b6ee2f949b48106c15c8ea0dfd09e36;hb=8d46f053043e2645da8a7c4d85d3cd321f9a5e3a;hpb=565d87c2aab7d3c389a958c068323683316e5e0f diff --git a/notmuch-reply.c b/notmuch-reply.c index dab69e66..27ef37bd 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. */ @@ -425,13 +427,13 @@ guess_from_received_header (notmuch_config_t *config, notmuch_message_t *message if (strcasestr(primary, domain)) { free(mta); - return primary; - } - for (i = 0; i < other_len; i++) - if (strcasestr (other[i],domain)) { - free(mta); - return other[i]; + return primary; } + for (i = 0; i < other_len; i++) + if (strcasestr (other[i],domain)) { + free(mta); + return other[i]; + } } free (mta); }