From 2e1292b731c80dc0aa15d5ec0668a4160d08d113 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 25 Apr 2020 00:22:21 +0200 Subject: smtp: set auth correctly Regression since 7.69.0 and 68fb25fa3fcff. The code wrongly assigned 'from' instead of 'auth' which probably was a copy and paste mistake from other code, leading to that auth could remain NULL and later cause an error to be returned. Assisted-by: Eric Sauvageau Fixes #5294 --- lib/smtp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/smtp.c b/lib/smtp.c index 93e004d20..bf65f246f 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -625,8 +625,7 @@ static CURLcode smtp_perform_mail(struct connectdata *conn) utf8 = TRUE; if(host.name) { - free(from); - from = aprintf("<%s@%s>", address, host.name); + auth = aprintf("<%s@%s>", address, host.name); Curl_free_idnconverted_hostname(&host); } @@ -636,8 +635,6 @@ static CURLcode smtp_perform_mail(struct connectdata *conn) auth = aprintf("<%s>", address); free(address); - if(!from) - return CURLE_OUT_OF_MEMORY; } else /* Empty AUTH, RFC-2554, sect. 5 */ -- cgit v1.2.1