From 0de67362be5fa5a1bc045701c9dc36c05c423809 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 24 Jun 2012 20:29:24 +0000 Subject: - added template mir_ptr for automatic memory deallocation using mir_free(); - mir_ptr used in MSN git-svn-id: http://svn.miranda-ng.org/main/trunk@614 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/msn_commands.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'protocols') diff --git a/protocols/MSN/msn_commands.cpp b/protocols/MSN/msn_commands.cpp index fbec551993..3fc028ad19 100644 --- a/protocols/MSN/msn_commands.cpp +++ b/protocols/MSN/msn_commands.cpp @@ -830,13 +830,15 @@ void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wli char* szStatMsg = ezxml_txt(ezxml_child(xmli, "PSM")); stripBBCode(szStatMsg); stripColorCode(szStatMsg); - TCHAR *tszStatMsg = mir_utf8decodeT(szStatMsg); - if (*tszStatMsg) - DBWriteContactSettingTString(hContact, "CList", "StatusMsg", tszStatMsg); - else - DBDeleteContactSetting(hContact, "CList", "StatusMsg"); + { + mir_ptr tszStatMsg = mir_utf8decodeT(szStatMsg); + if (*tszStatMsg) + DBWriteContactSettingTString(hContact, "CList", "StatusMsg", tszStatMsg); + else + DBDeleteContactSetting(hContact, "CList", "StatusMsg"); - SendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)tszStatMsg); + SendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)tszStatMsg); + } // Process current media info const char* szCrntMda = ezxml_txt(ezxml_child(xmli, "CurrentMedia")); -- cgit v1.2.3