summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/NewStory/src/history_control.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index 312f2296f8..e33d901ba3 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -335,7 +335,9 @@ static int LayoutItem(HWND hwnd, HistoryArray *items, int index)
static int PaintItem(HDC hdc, HistoryArray *items, int index, int top, int width)
{
- if (!items) return 0;
+ if (!items)
+ return 0;
+
ItemData *item = items->get(index, ItemData::ELM_DATA);
// LOGFONT lfText;
@@ -400,9 +402,7 @@ static int PaintItem(HDC hdc, HistoryArray *items, int index, int top, int width
}
if (!item->data) {
- wchar_t *buf = TplFormatString(tpl, item->hContact, item);
- item->data = MTextCreateW(htuLog, buf);
- mir_free(buf);
+ item->data = MTextCreateW(htuLog, ptrW(TplFormatString(tpl, item->hContact, item)));
if (!item->data)
return 0;
}