From b076b0ae89d74bf2c09df97c041f3588e020d0e9 Mon Sep 17 00:00:00 2001 From: Jeff Rowberg Date: Mon, 29 Jul 2019 12:03:20 -0400 Subject: [PATCH] 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 71bbc07d1..4c0155998 100644 --- a/cores/arduino/WString.cpp +++ b/cores/arduino/WString.cpp @@ -123,7 +123,7 @@ String::String(double value, unsigned char decimalPlaces) String::~String() { - free(buffer); + if (buffer) free(buffer); } /*********************************************/