Skip to content

Commit 590b21b

Browse files
jrowbergaentinger
authored andcommitted
Add null pointer test to String destructor
1 parent d2de78a commit 590b21b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/WString.cpp

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

124124
String::~String()
125125
{
126-
free(buffer);
126+
if (buffer) free(buffer);
127127
}
128128

129129
/*********************************************/

0 commit comments

Comments
 (0)