urlapi: avoid derefencing a possible NULL pointer

Coverity CID 1439134
This commit is contained in:
Daniel Stenberg 2018-09-08 22:57:36 +02:00
parent 82846a456a
commit 01dedc99fc
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 2 additions and 2 deletions

View File

@ -438,10 +438,10 @@ static CURLUcode parse_hostname_login(struct Curl_URL *u,
*hostname = ++ptr;
/* We could use the login information in the URL so extract it. Only parse
options if the handler says we should. */
options if the handler says we should. Note that 'h' might be NULL! */
ccode = Curl_parse_login_details(login, ptr - login - 1,
&userp, &passwdp,
h->flags & PROTOPT_URLOPTIONS ?
(h && (h->flags & PROTOPT_URLOPTIONS)) ?
&optionsp:NULL);
if(ccode) {
result = CURLUE_MALFORMED_INPUT;