summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/main.cpp
diff options
context:
space:
mode:
authorAlexander Gluzsky <sss123next@list.ru>2013-07-31 23:16:34 +0000
committerAlexander Gluzsky <sss123next@list.ru>2013-07-31 23:16:34 +0000
commitdaf3e389b479f28b306e7c88ecc49119f0bbf542 (patch)
tree8858bf836dc1009ddaf1718525ff8965fd127754 /plugins/New_GPG/src/main.cpp
parent971d0acab1eb3c9405e8b0e8d839c3f751af2e5b (diff)
fixed few logic bugs
fixed few memory leaks prevent db helper functions from returning uninitialized ptr git-svn-id: http://svn.miranda-ng.org/main/trunk@5542 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/main.cpp')
-rwxr-xr-x[-rw-r--r--]plugins/New_GPG/src/main.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index 41d568f8fa..39879537c1 100644..100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -233,6 +233,7 @@ static INT_PTR CALLBACK DlgProcFirstRun(HWND hwndDlg,UINT msg,WPARAM wParam,LPAR
accs += accounts[i]->tszAccountName;
}
}
+ mir_free(str);
}
ListView_SetItemText(hwndList, iRow, 6, (TCHAR*)accs.c_str());
}
@@ -891,7 +892,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
if(!boost::filesystem::exists(tmp))
MessageBox(0, TranslateT("wrong gpg binary location found in system.\nplease choose another location"), TranslateT("Warning"), MB_OK);
}
- else tmp = mir_wstrdup(path);
+ else
+ tmp = mir_wstrdup(path);
mir_free(path);
SetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp);
@@ -2125,7 +2127,7 @@ void InitCheck()
PROTOACCOUNT **accounts;
ProtoEnumAccounts(&count, &accounts);
string question;
- char *keyid, *key;
+ char *keyid = nullptr, *key = nullptr;
for(int i = 0; i < count; i++)
{
if(StriStr(accounts[i]->szModuleName, "metacontacts"))
@@ -2141,6 +2143,7 @@ void InitCheck()
if(keyid[0])
{
question = Translate("Your secret key whith id: ");
+ mir_free(keyid);
keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");
key = UniGetContactSettingUtf(NULL, szGPGModuleName, "GPGPubKey", "");
void ShowFirstRunDialog();
@@ -2198,7 +2201,11 @@ void InitCheck()
mir_free(expire_date);
}
}
- mir_free(keyid);
+ if(keyid)
+ {
+ mir_free(keyid);
+ keyid = nullptr;
+ }
}
question = Translate("Your secret key whith id: ");
keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", "");