From f45c6111f5b86d327e30b3709c92321248534398 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 7 Dec 2023 13:18:36 +0300 Subject: fixes #4006 (NewStory: crash when editing Jabber messages) --- plugins/NewStory/src/history_control.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/NewStory') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 2a35563195..dfa7669dee 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -328,7 +328,8 @@ void NewstoryListData::EndEditItem(bool bAccept) auto *pItem = GetItem(caret); int iTextLen = GetWindowTextLengthW(hwndEditBox); - replaceStrW(pItem->wtext, (wchar_t *)mir_alloc((iTextLen + 1) * sizeof(wchar_t))); + mir_free(pItem->wtext); + pItem->wtext = (wchar_t *)mir_alloc((iTextLen + 1) * sizeof(wchar_t)); GetWindowTextW(hwndEditBox, pItem->wtext, iTextLen+1); pItem->wtext[iTextLen] = 0; -- cgit v1.2.3