diff --git a/lib/netrc.c b/lib/netrc.c index 4afd2a0846..971e4b81de 100644 --- a/lib/netrc.c +++ b/lib/netrc.c @@ -268,7 +268,7 @@ static NETRCcode parsenetrc(struct store_netrc *store, else { our_login = TRUE; free(login); - login = strdup(tok); + login = strdup(tok ? tok : ""); if(!login) { retcode = NETRC_OUT_OF_MEMORY; /* allocation failed */ goto out;