summaryrefslogtreecommitdiff
path: root/plugins/NewStory
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-12-07 13:18:36 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-12-07 13:18:36 +0300
commitf45c6111f5b86d327e30b3709c92321248534398 (patch)
tree90487e26dc56f4aff81f7ffbd92b4425b6019b81 /plugins/NewStory
parent7b2896b91ed33fe16b7dcd1213c01c004a85a4e8 (diff)
fixes #4006 (NewStory: crash when editing Jabber messages)
Diffstat (limited to 'plugins/NewStory')
-rw-r--r--plugins/NewStory/src/history_control.cpp3
1 files changed, 2 insertions, 1 deletions
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;