mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-30 16:10:44 +08:00
Merge pull request #2646 from ZhipengXue97/next
Fix potential null dereference
This commit is contained in:
commit
2cd9d2674a
@ -1156,6 +1156,15 @@ aws_load_credentials(NCglobalstate* gstate)
|
||||
if((stat = awsparse(text,profiles))) goto done;
|
||||
}
|
||||
}
|
||||
|
||||
/* add a "none" credentials */
|
||||
{
|
||||
struct AWSprofile* noprof = (struct AWSprofile*)calloc(1,sizeof(struct AWSprofile));
|
||||
if(noprof == NULL) {stat = NC_ENOMEM; goto done;}
|
||||
noprof->name = strdup("none");
|
||||
noprof->entries = nclistnew();
|
||||
nclistpush(profiles,noprof); noprof = NULL;
|
||||
}
|
||||
|
||||
if(gstate->rcinfo->s3profiles)
|
||||
freeprofilelist(gstate->rcinfo->s3profiles);
|
||||
|
Loading…
Reference in New Issue
Block a user