From 7d8823aa0ccba658db3ba881bbb429e6b5b33985 Mon Sep 17 00:00:00 2001 From: Marcin Kajor <98948394+markaj-nordic@users.noreply.github.com> Date: Tue, 13 Feb 2024 02:55:38 +0100 Subject: [PATCH] [nrfconnect] Fix memory leak in Window Covering sample. (#32041) We were leaking 8 bytes each time the new attribute change was reported by the WindowCovering Server. It was resulting in running out of heap when stressing the device (by sending multiple up-or-open/down-or-close commands). Signed-off-by: Marcin Kajor --- examples/window-app/nrfconnect/main/WindowCovering.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/window-app/nrfconnect/main/WindowCovering.cpp b/examples/window-app/nrfconnect/main/WindowCovering.cpp index f2d078838a427b..a11104fe2ad89b 100644 --- a/examples/window-app/nrfconnect/main/WindowCovering.cpp +++ b/examples/window-app/nrfconnect/main/WindowCovering.cpp @@ -343,4 +343,6 @@ void WindowCovering::DoPostAttributeChange(intptr_t aArg) VerifyOrReturn(data != nullptr); PostAttributeChange(data->mEndpoint, data->mAttributeId); + + chip::Platform::Delete(data); }