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 <mjeanson@debian.org>
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)