diff --git a/ncrypt/crypt_gpgme.c b/ncrypt/crypt_gpgme.c index 8cd70fd6268..50c588a2755 100644 --- a/ncrypt/crypt_gpgme.c +++ b/ncrypt/crypt_gpgme.c @@ -3581,7 +3581,7 @@ static struct CryptKeyInfo *crypt_getkeybyaddr(struct Address *a, *forced_valid = 0; if (a && a->mailbox) - mutt_list_insert_tail(&hints, a->mailbox); + mutt_list_insert_tail(&hints, mutt_str_dup(a->mailbox)); if (a && a->personal) crypt_add_string_to_hints(a->personal, &hints); diff --git a/ncrypt/pgpkey.c b/ncrypt/pgpkey.c index 665f9afe416..45ceb8b8ad4 100644 --- a/ncrypt/pgpkey.c +++ b/ncrypt/pgpkey.c @@ -369,7 +369,7 @@ struct PgpKeyInfo *pgp_getkeybyaddr(struct Address *a, KeyFlags abilities, struct PgpUid *q = NULL; if (a->mailbox) - mutt_list_insert_tail(&hints, a->mailbox); + mutt_list_insert_tail(&hints, mutt_str_dup(a->mailbox)); if (a->personal) pgp_add_string_to_hints(a->personal, &hints);