X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=27ef37bd914cd0af1da57f8dd60bf33f1509cfce;hp=5265af6dde0adce2c43e2944c3d221b0a00c1cce;hb=8d46f053043e2645da8a7c4d85d3cd321f9a5e3a;hpb=2e653db38fc38dee92b2ee0564e27921132e7232 diff --git a/notmuch-reply.c b/notmuch-reply.c index 5265af6d..27ef37bd 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -401,11 +401,14 @@ 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. */ + domain = tld = NULL; while ((ptr = strsep (&token, delim)) != NULL) { if (*ptr == '\0') continue; @@ -424,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); } @@ -607,7 +610,7 @@ notmuch_reply_command (void *ctx, int argc, char *argv[]) } } else if ((STRNCMP_LITERAL (argv[i], "--decrypt") == 0)) { if (params.cryptoctx == NULL) { - GMimeSession* session = g_object_new(notmuch_gmime_session_get_type(), NULL); + GMimeSession* session = g_object_new(g_mime_session_get_type(), NULL); if (NULL == (params.cryptoctx = g_mime_gpg_context_new(session, "gpg"))) fprintf (stderr, "Failed to construct gpg context.\n"); else