summaryrefslogtreecommitdiff
path: root/plugins/MirOTR/src/otr.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-07-25 14:54:09 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-07-25 14:54:09 +0000
commit075c7777370258c5e1ccff1dc22f31b416e1e761 (patch)
tree72ad321b228f71eec6c577e256347f2ee0d631bf /plugins/MirOTR/src/otr.cpp
parent2a81bd5a12324512985116f17674c65a5906ed1d (diff)
MirOTR:
- Fixed small memory leak git-svn-id: http://svn.miranda-ng.org/main/trunk@14690 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirOTR/src/otr.cpp')
-rw-r--r--plugins/MirOTR/src/otr.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp
index b7ee6b3963..26a4a9423d 100644
--- a/plugins/MirOTR/src/otr.cpp
+++ b/plugins/MirOTR/src/otr.cpp
@@ -64,7 +64,7 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM
GenKeyData *data = (GenKeyData *)mir_calloc(sizeof(GenKeyData));
data->dialog = hWndDlg;
data->proto = (char*)lParam;
- CloseHandle((HANDLE)_beginthreadex(0, 0, generate_key_thread, (void*)data, 0, 0));
+ CloseHandle((HANDLE)_beginthreadex(0, 0, generate_key_thread, data, 0, 0));
}break;
case WMU_ENDDIALOG:
EndDialog(hWndDlg, 0);
@@ -72,6 +72,7 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_DESTROY:
SetClassLongPtr(hWndDlg, GCLP_HICON, 0);
IcoLib_Release(ICON_OTR, 1);
+ mir_free((char*)lParam);
}
return FALSE;
}
@@ -103,7 +104,10 @@ extern "C" {
* desired. */
void otr_gui_create_privkey(void *opdata, const char *account_name, const char *protocol) {
DEBUGOUT_T("OTR_GUI_CREATE_PRIVKEY\n");
- if (opdata) protocol = GetContactProto((MCONTACT)opdata);
+ if (opdata) {
+ mir_free((char*)protocol);
+ protocol = mir_strdup(GetContactProto((MCONTACT)opdata));
+ }
if (!protocol) return;
DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_GENKEYNOTIFY), 0, GenKeyDlgBoxProc, (LPARAM)protocol);