diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-04-25 00:22:21 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-04-25 00:23:17 +0200 |
commit | 2e1292b731c80dc0aa15d5ec0668a4160d08d113 (patch) | |
tree | 9e395467f8f259eba3f31242d3233429ea51bb48 | |
parent | ba7b94b1e74745eb8900ca4cccdec47473fc78f3 (diff) | |
download | curl-bagder/smtp-auth-fix.tar.gz |
smtp: set auth correctlybagder/smtp-auth-fix
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
-rw-r--r-- | lib/smtp.c | 5 |
1 files changed, 1 insertions, 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 */ |