From b863cf3ed836eed055c90a4d8248883c8249e88c Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 29 Dec 2025 21:17:02 +0100 Subject: [PATCH] savePreset() fix mutex leak in early return path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit early return considered harmful 😆 --- wled00/presets.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wled00/presets.cpp b/wled00/presets.cpp index 996aff3b..7b83e21d 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -336,7 +336,10 @@ void savePreset(byte index, const char* pname, JsonObject sObj) } presetToSave = 0; - if (index > 250 || !fileDoc) return; // cannot save API calls to temporary preset (255) + if (index > 250 || !fileDoc) { + esp32SemGive(presetFileMux); // Release file mutex + return; // cannot save API calls to temporary preset (255) + } sObj.remove("o"); sObj.remove("v"); sObj.remove("time");