summaryrefslogtreecommitdiff
path: root/tipper/subst.cpp
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-12-09 11:19:36 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2006-12-09 11:19:36 +0000
commit5aab2f53c4b6062a125cbe5242992efad0ff68ef (patch)
tree71f93fe514c77303e0fe5a5d568a574fae938707 /tipper/subst.cpp
parentf8f8072f5195d00bdd8967f291c680643659d919 (diff)
memory leaks and dc font reset (thx George)
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@70 4f64403b-2f21-0410-a795-97e2b3489a10
Diffstat (limited to 'tipper/subst.cpp')
-rw-r--r--tipper/subst.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tipper/subst.cpp b/tipper/subst.cpp
index f7e7f5d..aac9e8f 100644
--- a/tipper/subst.cpp
+++ b/tipper/subst.cpp
@@ -121,7 +121,7 @@ TCHAR *GetLastMessageText(HANDLE hContact) {
}
if(hDbEvent) {
- dbei.pBlob = (BYTE *)malloc(dbei.cbBlob);
+ dbei.pBlob = (BYTE *)alloca(dbei.cbBlob);
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
if(dbei.cbBlob == 0 || dbei.pBlob == 0) return 0;
@@ -194,6 +194,7 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *raw_spec, TCHAR *buff, int bufflen)
TCHAR *msg = GetLastMessageText(hContact);
if(msg) {
_tcsncpy(buff, msg, bufflen);
+ free(msg);
return true;
}
} else if (!_tcscmp(raw_spec, _T("meta_subname"))) {