From a187813a93a1f0be12ec0bb8faa0b956517c55ad Mon Sep 17 00:00:00 2001 From: Alexander Gluzsky Date: Thu, 9 Jul 2015 17:18:30 +0000 Subject: new_gpg: few crash fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@14519 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/main.cpp | 4 +++- plugins/New_GPG/src/messages.cpp | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp index 93c1c704f9..261b622407 100755 --- a/plugins/New_GPG/src/main.cpp +++ b/plugins/New_GPG/src/main.cpp @@ -861,7 +861,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SetCurrentDirectoryA(mir_path); tmp = mir_a2t(mir_path); mir_free(mir_path); - mir_realloc(path, (mir_tstrlen(path)+128)*sizeof(TCHAR)); + //mir_realloc(path, (mir_tstrlen(path)+128)*sizeof(TCHAR)); TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH), *gpg_lang_path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH); mir_tstrcpy(gpg_path, tmp); mir_tstrcat(gpg_path, _T("\\GnuPG\\gpg.exe")); @@ -873,6 +873,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, gpg_exists = true; mir_tstrcpy(path, _T("GnuPG\\gpg.exe")); } + else + mir_tstrcpy(path, gpg_path); if(boost::filesystem::exists(gpg_lang_path)) lang_exists = true; if(gpg_exists && !lang_exists) diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp index fbaea6013b..036cb60fd1 100755 --- a/plugins/New_GPG/src/messages.cpp +++ b/plugins/New_GPG/src/messages.cpp @@ -978,7 +978,6 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp)+1)); mir_tstrcpy(password, tmp); } - mir_free(tmp); mir_free(inkeyid); DestroyWindow(hwndDlg); } -- cgit v1.2.3