Skip to content

Commit

Permalink
Merge pull request #2646 from ZhipengXue97/next
Browse files Browse the repository at this point in the history
Fix potential null dereference
  • Loading branch information
WardF authored Aug 1, 2023
2 parents aee19e2 + dc3c45e commit 2cd9d26
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libdispatch/drc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2cd9d26

Please sign in to comment.