summaryrefslogtreecommitdiff
path: root/plugins/CryptoPP/src/cpp_keys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CryptoPP/src/cpp_keys.cpp')
-rw-r--r--plugins/CryptoPP/src/cpp_keys.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/CryptoPP/src/cpp_keys.cpp b/plugins/CryptoPP/src/cpp_keys.cpp
index ec1659f179..37a197d70f 100644
--- a/plugins/CryptoPP/src/cpp_keys.cpp
+++ b/plugins/CryptoPP/src/cpp_keys.cpp
@@ -56,10 +56,14 @@ LPSTR __cdecl cpp_init_keya(HANDLE context, int features)
}
memcpy((PVOID)&publ1[KEYSIZE], (PVOID)&send_features, 2);
+ mir_free(ptr->tmp);
if (ptr->mode & MODE_BASE64 || features & FEATURES_NEWPG)
- replaceStr(ptr->tmp, mir_base64_encode(publ1, KEYSIZE + 2));
- else
- replaceStr(ptr->tmp, base16encode((LPSTR)&publ1, KEYSIZE + 2));
+ ptr->tmp = mir_base64_encode(publ1, KEYSIZE + 2);
+ else {
+ char *base16 = base16encode((LPSTR)&publ1, KEYSIZE + 2);
+ ptr->tmp = mir_strdup(base16);
+ free(base16);
+ }
return ptr->tmp;
}