Skip to content

Commit b478eac

Browse files
committed
Merge pull request #873 from Links2004/string_fix
fix possible free of null in String
2 parents 5186a92 + 996f2b5 commit b478eac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/esp8266/WString.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ ICACHE_FLASH_ATTR String::String(double value, unsigned char decimalPlaces) {
118118
}
119119

120120
ICACHE_FLASH_ATTR String::~String() {
121-
free(buffer);
121+
if(buffer) {
122+
free(buffer);
123+
}
122124
}
123125

124126
// /*********************************************/

0 commit comments

Comments
 (0)