Fix potential null dereference

This commit is contained in:
Zhipeng Xue 2023-02-28 18:29:40 +08:00
parent 00a722b253
commit e0792b41a0

View File

@ -1139,6 +1139,7 @@ aws_load_credentials(NCglobalstate* gstate)
/* add a "none" credentials */
{
struct AWSprofile* noprof = (struct AWSprofile*)calloc(1,sizeof(struct AWSprofile));
if(noprof == NULL) {ret = NC_ENOMEM; goto done;}
noprof->name = strdup("none");
noprof->entries = nclistnew();
nclistpush(profiles,noprof); noprof = NULL;