Skip to content

Commit

Permalink
Resolve bad delete #98
Browse files Browse the repository at this point in the history
Use `delete[]` rather `delete` for deleting heap allocated char array.
  • Loading branch information
twsearle authored Nov 26, 2021
1 parent a982f07 commit 2b4b1f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cxx4/ncGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ string NcGroup::getName(bool fullName) const {
char* charName= new char[lenp+1];
ncCheck(nc_inq_grpname_full(myId,&lenp,charName),__FILE__,__LINE__);
groupName = charName;
delete charName;
delete[] charName;
}
else {
// return the (local) name of this group.
Expand Down

0 comments on commit 2b4b1f4

Please sign in to comment.