mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-02-17 16:50:18 +08:00
Corrected a couple of static analysis-detected warnings.
This commit is contained in:
parent
b40068afdb
commit
473163c41a
@ -222,6 +222,8 @@ ocset_flags_perlink(OCstate* state)
|
||||
if(stat == OC_NOERR) stat = ocset_curlflag(state,CURLOPT_USERPWD);
|
||||
if(stat == OC_NOERR) stat = ocset_curlflag(state,CURLOPT_PROXY);
|
||||
if(stat == OC_NOERR) stat = ocset_curlflag(state,CURLOPT_USE_SSL);
|
||||
if(stat != OC_NOERR)
|
||||
return stat;
|
||||
|
||||
/* Following are always set */
|
||||
ocset_curlflag(state, CURLOPT_FOLLOWLOCATION);
|
||||
@ -248,7 +250,10 @@ oc_set_curl_options(OCstate* state)
|
||||
struct OCCURLFLAG* ocflag = NULL;
|
||||
|
||||
hostport = occombinehostport(state->uri);
|
||||
if(hostport == NULL) hostport = "";
|
||||
if(hostport == NULL) {
|
||||
hostport = (char*)malloc(sizeof(char)*1);
|
||||
*hostport = "";
|
||||
}
|
||||
|
||||
store = &ocglobalstate.rc.ocrc;
|
||||
triple = store->triples;
|
||||
@ -270,7 +275,7 @@ oc_set_curl_options(OCstate* state)
|
||||
stat = ocset_curlopt(state,ocflag->flag,cvt(triple->value,ocflag->type));
|
||||
}
|
||||
done:
|
||||
if(hostport && hostport != "") free(hostport);
|
||||
if(hostport && *hostport != "") free(hostport);
|
||||
return stat;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user