Skip to content

Commit

Permalink
Add null pointer check to String destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
MCUdude committed Jan 19, 2023
1 parent 811b516 commit 4543713
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion WString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ String::String(double value, unsigned char decimalPlaces)

String::~String()
{
free(buffer);
if(buffer)
free(buffer);
}

/*********************************************/
Expand Down

0 comments on commit 4543713

Please sign in to comment.