From: Ralph Corderoy Date: Sat, 22 Oct 2016 15:04:58 +0000 (+0100) Subject: Replace getcpy() with mh_xstrdup() where the string isn't NULL. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/04fe5667ca51ed208fa4ba2e6e618904e9fb8702?ds=inline;hp=5b01163dec51496cc4c50648d6674d67f0092a33 Replace getcpy() with mh_xstrdup() where the string isn't NULL. --- diff --git a/sbr/credentials.c b/sbr/credentials.c index 8dd6129a..d8e4d2e4 100644 --- a/sbr/credentials.c +++ b/sbr/credentials.c @@ -61,12 +61,12 @@ nmh_get_credentials (const char *host, const char *user) creds = mh_xmalloc(sizeof(*creds)); - creds->host = getcpy(host); + creds->host = mh_xstrdup(host); creds->user = NULL; creds->pass = NULL; if (cred_style == NULL || ! strcmp (cred_style, "legacy")) { - creds->user = user == NULL ? getcpy(getusername ()) : getcpy(user); + creds->user = user == NULL ? mh_xstrdup(getusername ()) : mh_xstrdup(user); } else if (! strncasecmp (cred_style, "file:", 5) || ! strncasecmp (cred_style, "file-nopermcheck:", 17)) { /* @@ -77,7 +77,7 @@ nmh_get_credentials (const char *host, const char *user) * 3) interactively request from user (as long as the * credentials file didn't have a "default" token) */ - creds->user = user == NULL ? NULL : getcpy(user); + creds->user = user == NULL ? NULL : mh_xstrdup(user); } else { admonish (NULL, "unknown credentials style %s", cred_style); return NULL;