Skip to content

Commit ed8745d

Browse files
jrowbergaentinger
authored andcommitted
Add null pointer test to String destructor
1 parent 8014866 commit ed8745d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: cores/arduino/WString.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ String::String(double value, unsigned char decimalPlaces)
121121

122122
String::~String()
123123
{
124-
free(buffer);
124+
if (buffer) free(buffer);
125125
}
126126

127127
/*********************************************/

0 commit comments

Comments
 (0)