diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-17 12:04:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-17 12:04:21 +0000 |
commit | fe4e211fe45a0b04190d06dbf34fa13883df871a (patch) | |
tree | 04ac31b85c5107e35af6903492e3f0db08119e28 /plugins/MyDetails | |
parent | 93bbcf1646e427be610273ae977a349705dcf39c (diff) |
more memory fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@4072 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MyDetails')
-rw-r--r-- | plugins/MyDetails/src/data.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/plugins/MyDetails/src/data.cpp b/plugins/MyDetails/src/data.cpp index fa9ebf2ae9..e38c23ce7e 100644 --- a/plugins/MyDetails/src/data.cpp +++ b/plugins/MyDetails/src/data.cpp @@ -239,26 +239,14 @@ bool Protocol::CanSetStatusMsg(int aStatus) void Protocol::GetStatusMsg(int aStatus, TCHAR *msg, size_t msg_size)
{
if ( !CanGetStatusMsg())
- {
lcopystr(msg, _T(""), msg_size);
- return;
- }
-
- if (aStatus == status && ProtoServiceExists(name, PS_GETMYAWAYMSG) )
- {
- TCHAR *tmp = (TCHAR*) CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR);
+ else if (aStatus == status && ProtoServiceExists(name, PS_GETMYAWAYMSG)) {
+ mir_ptr<TCHAR> tmp((TCHAR*)CallProtoService(name, PS_GETMYAWAYMSG, 0, SGMA_TCHAR));
lcopystr(msg, tmp == NULL ? _T("") : tmp, msg_size);
}
-
- else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSG))
- {
- TCHAR *tmp = (TCHAR*) CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, 0);
- if (tmp != NULL)
- {
- lcopystr(msg, tmp, msg_size);
- mir_free(tmp);
- }
- else lcopystr(msg, _T(""), msg_size);
+ else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSG)) {
+ mir_ptr<TCHAR> tmp((TCHAR*)CallService(MS_AWAYMSG_GETSTATUSMSGT, (WPARAM)aStatus, 0));
+ lcopystr(msg, tmp == NULL ? _T("") : tmp, msg_size);
}
}
|