summaryrefslogtreecommitdiff
path: root/tipper/popwin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tipper/popwin.cpp')
-rw-r--r--tipper/popwin.cpp14
1 files changed, 8 insertions, 6 deletions
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;