From 239ad94877dcf2ef148143ab3c7debde94dbb6cc Mon Sep 17 00:00:00 2001 From: sje Date: Mon, 25 Jun 2007 00:55:58 +0000 Subject: fix for memory links using the (currently unused) alternate status message retrieval service git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@209 4f64403b-2f21-0410-a795-97e2b3489a10 --- tipper/popwin.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'tipper/popwin.cpp') diff --git a/tipper/popwin.cpp b/tipper/popwin.cpp index 2189517..7ff1cee 100644 --- a/tipper/popwin.cpp +++ b/tipper/popwin.cpp @@ -99,15 +99,16 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if(status >= ID_STATUS_OFFLINE && status <= ID_STATUS_IDLE) { TCHAR *swzText = 0; char *status_msg = 0; - if(ServiceExists(MS_AWAY_GETPROTOSTATUSMESSAGET)) - swzText = _tcsdup((TCHAR *)CallService(MS_AWAY_GETPROTOSTATUSMESSAGET, (LPARAM)status, (WPARAM)pwd->clcit.proto)); - else if(ServiceExists(MS_AWAY_GETPROTOSTATUSMESSAGE)) + if(ServiceExists(MS_AWAY_GETPROTOSTATUSMESSAGET)) { + TCHAR *temp = (TCHAR *)CallService(MS_AWAY_GETPROTOSTATUSMESSAGET, (LPARAM)status, (WPARAM)pwd->clcit.proto); + swzText = _tcsdup(temp); + mir_free(temp); + } else if(ServiceExists(MS_AWAY_GETPROTOSTATUSMESSAGE)) status_msg = (char *)CallService(MS_AWAY_GETPROTOSTATUSMESSAGE, (LPARAM)status, (WPARAM)pwd->clcit.proto); else status_msg = (char *)CallService(MS_AWAYMSG_GETSTATUSMSG, status, 0); - if(status_msg) - swzText = a2t(status_msg); + if(status_msg) swzText = a2t(status_msg); if(swzText) { StripBBCodesInPlace(swzText); @@ -119,8 +120,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->rows[pwd->row_count].line_above = true; pwd->row_count++; - mir_free(status_msg); } + + if(status_msg) mir_free(status_msg); } } else if(pwd->clcit.text) { pwd->text_tip = true; -- cgit v1.2.3