mirror of
https://github.com/curl/curl.git
synced 2026-04-15 01:21:44 +03:00
netrc: avoid strdup NULL
Coverity found a code path where this might happen. Avoid it. Closes #17319
This commit is contained in:
parent
5f6c714d24
commit
c5398fa393
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue