diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2012-08-18 03:00:02 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2012-08-18 03:00:02 +0300 |
commit | d2ffea815c2763595d6ef9b96ced20d45944135f (patch) | |
tree | cc24e84dd3804598b8d17bd918f6988845235e14 /src/main.cpp | |
parent | 5fa836175d96451c4e3d60761b017371a2f7495c (diff) |
possible memmory corruption fixes
Diffstat (limited to 'src/main.cpp')
-rwxr-xr-x | src/main.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.cpp b/src/main.cpp index 0c212d4..e28114c 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -2261,7 +2261,7 @@ void ImportKey() s2 = output.find("<", s); else if(s2 > output.find("<", s)) s2 = output.find("<", s); - tmp = new char [output.substr(s,s2-s-1).length()+1]; + tmp = (char*)mir_alloc(sizeof(char)*(output.substr(s,s2-s-1).length()+1)); strcpy(tmp, output.substr(s,s2-s-1).c_str()); mir_utf8decode(tmp, 0); DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainName", tmp); @@ -2273,14 +2273,14 @@ void ImportKey() s2++; if(output[s] == ')') { - tmp = new char [output.substr(s2,s-s2).length()+1]; + tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); DBWriteContactSettingString(hContact, szGPGModuleName, "KeyComment", tmp); mir_free(tmp); s+=3; s2 = output.find(">", s); - tmp = new char [output.substr(s,s2-s).length()+1]; + tmp = (char*) mir_alloc(sizeof(char)*(output.substr(s,s2-s).length()+1)); strcpy(tmp, output.substr(s,s2-s).c_str()); mir_utf8decode(tmp, 0); DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", tmp); @@ -2288,7 +2288,7 @@ void ImportKey() } else { - tmp = new char [output.substr(s2,s-s2).length()+1]; + tmp = (char*)mir_alloc(sizeof(char)* (output.substr(s2,s-s2).length()+1)); strcpy(tmp, output.substr(s2,s-s2).c_str()); mir_utf8decode(tmp, 0); DBWriteContactSettingString(hContact, szGPGModuleName, "KeyMainEmail", output.substr(s2,s-s2).c_str()); |