From c9b177bb9e0eddf4bb858746fe9e4e667a458c02 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 17 May 2022 18:08:40 +0200 Subject: [PATCH] Fix a memory leak in "Copy Binary Content" comment Ref: https://github.com/notepad-plus-plus/notepad-plus-plus/issues/11671#issuecomment-1128975960 --- PowerEditor/src/NppCommands.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 4f886c8b2..9bf024b6b 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -398,6 +398,8 @@ void Notepad_plus::command(int id) memcpy(lpucharCopy, pBinText, textLen * sizeof(unsigned char)); lpucharCopy[textLen] = 0; // null character + delete[] pBinText; + GlobalUnlock(hglbCopy); // Place the handle on the clipboard.