From c270eaabf4b7e85b0cfbb96c57817af5995b5ad8 Mon Sep 17 00:00:00 2001 From: Jeff Rowberg Date: Mon, 29 Jul 2019 12:16:41 -0400 Subject: Add null pointer test to String destructor --- cores/arduino/WString.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp index f2572d6..043fda7 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -121,7 +121,7 @@ String::String(double value, unsigned char decimalPlaces) String::~String() { - free(buffer); + if (buffer) free(buffer); } /*********************************************/ -- cgit v1.2.3-18-g5258