From: Michael Jeanson Date: Fri, 1 Mar 2024 19:10:02 +0000 (-0500) Subject: WIP: Should use rhost? X-Git-Tag: RELEASE_1_4_5~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20354f57c46c78b91255424385728a3f169673ca;p=thirdparty%2Fmlmmj.git WIP: Should use rhost? 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 --- 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)