From 20354f57c46c78b91255424385728a3f169673ca Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Fri, 1 Mar 2024 14:10:02 -0500 Subject: [PATCH] WIP: Should use rhost? MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I'm not sure this is the correct fix but the current code tries to duplicate the string 'relayhost' which is always NULL at this point. In file included from send_mail.c:39: In function ‘xstrdup’, inlined from ‘newsmtp’ at send_mail.c:362:15: ../include/xmalloc.h:34:19: warning: argument 1 null where non-null expected [-Wnonnull] 34 | char *s = strdup(str); | ^~~~~~~~~~~ In file included from ../include/log_error.h:28, from send_mail.c:34: /usr/include/string.h: In function ‘newsmtp’: /usr/include/string.h:187:14: note: in a call to function ‘strdup’ declared ‘nonnull’ 187 | extern char *strdup (const char *__s) | ^~~~~~ Signed-off-by: Michael Jeanson --- src/send_mail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/send_mail.c b/src/send_mail.c index 3196b865..017ebfe8 100644 --- a/src/send_mail.c +++ b/src/send_mail.c @@ -359,7 +359,7 @@ newsmtp(struct ml *ml, const char *rhost) unsigned short smtpport = ctrlushort(ml->ctrlfd, "smtpport", 25); if (rhost != NULL) - relayhost = xstrdup(relayhost); + relayhost = xstrdup(rhost); if (relayhost == NULL) relayhost = ctrlvalue(ml->ctrlfd, "relayhost"); if (relayhost == NULL) -- 2.47.3