From e58ad6aa75ca11ab3b7db21280eba53c20e7731b Mon Sep 17 00:00:00 2001 From: Jerry Date: Fri, 5 Sep 2025 08:20:33 +0800 Subject: [PATCH] Fix memory leak by gzip --- src/API.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/API.hpp b/src/API.hpp index cd482b8..641bfdc 100755 --- a/src/API.hpp +++ b/src/API.hpp @@ -8,7 +8,6 @@ #include // 解压gzip - struct Weather { String time; int8_t temp; @@ -109,6 +108,7 @@ private: size_t outLen = 0; ArduinoUZlib::decompress((uint8_t*)s.c_str(), (uint32_t)s.length(), outBuf, outLen); error = deserializeJson(doc, (char*)outBuf, outLen); + free(outBuf); } else { error = deserializeJson(doc, s); }