diff options
author | George Hazan <ghazan@miranda.im> | 2018-11-07 23:07:51 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-11-07 23:07:51 +0300 |
commit | 57125f88567ba481594204c08d3eff983c3017c8 (patch) | |
tree | f34aa04b9d283d353f02b8b4ac175b1280cbe27c /plugins/IEHistory | |
parent | 08e2f2b731c2a696b1c23edd1ac0e911c2336dba (diff) |
IEHistory: memory allocation fix
Diffstat (limited to 'plugins/IEHistory')
-rw-r--r-- | plugins/IEHistory/src/dlgHandlers.cpp | 5 | ||||
-rw-r--r-- | plugins/IEHistory/src/utils.cpp | 10 | ||||
-rw-r--r-- | plugins/IEHistory/src/utils.h | 1 |
3 files changed, 2 insertions, 14 deletions
diff --git a/plugins/IEHistory/src/dlgHandlers.cpp b/plugins/IEHistory/src/dlgHandlers.cpp index b4a70b1866..f5db4c4597 100644 --- a/plugins/IEHistory/src/dlgHandlers.cpp +++ b/plugins/IEHistory/src/dlgHandlers.cpp @@ -69,11 +69,10 @@ void LoadName(HWND hWnd) SetWindowText(hWnd, TranslateT("System History"));
return;
}
- wchar_t *szOther = GetContactName(data->contact);
+
wchar_t buffer[1024];
- sntprintf(buffer, 1024, L"'%s' - IEHistory", szOther);
+ sntprintf(buffer, 1024, L"'%s' - IEHistory", ptrW(Contact_GetInfo(CNF_DISPLAY, data->contact)).get());
SetWindowText(hWnd, buffer);
- mir_free(szOther);
}
int LoadIEView(HWND hWnd)
diff --git a/plugins/IEHistory/src/utils.cpp b/plugins/IEHistory/src/utils.cpp index fc40eeba25..d1699bdb45 100644 --- a/plugins/IEHistory/src/utils.cpp +++ b/plugins/IEHistory/src/utils.cpp @@ -75,16 +75,6 @@ int Info(char *title, char *format, ...) } /* -returns the name of a contact -*/ - -wchar_t* GetContactName(MCONTACT contact) -{ - ptrW name(Contact_GetInfo(CNF_DISPLAY, contact)); - return (name) ? wcsdup(name) : nullptr; -} - -/* Moves a control with regard to certain anchors (like delphi, c#, ...) Somebody please improve on this code ... */ diff --git a/plugins/IEHistory/src/utils.h b/plugins/IEHistory/src/utils.h index a8c98ef30b..55c076a475 100644 --- a/plugins/IEHistory/src/utils.h +++ b/plugins/IEHistory/src/utils.h @@ -68,7 +68,6 @@ int Log(char *format, ...); void ScreenToClient(HWND hWnd, LPRECT rect); int Info(char *title, char *format, ...); -wchar_t *GetContactName(MCONTACT contact); void AnchorMoveWindow(HWND window, const WINDOWPOS *parentPos, int anchors); RECT AnchorCalcPos(HWND window, const RECT *rParent, const WINDOWPOS *parentPos, int anchors); |