From 3d0349191da06ff9ebf3d676ceda98ccd650ee42 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 3 Dec 2014 21:00:25 -0500 Subject: [PATCH] fixed memory corruption --- Identity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Identity.cpp b/Identity.cpp index 4d6ef18b..a5825da8 100644 --- a/Identity.cpp +++ b/Identity.cpp @@ -346,8 +346,9 @@ namespace data size_t l1 = i2p::data::ByteStreamToBase64 (buf, l, str, GetFullLen ()*2); str[l1] = 0; delete[] buf; + std::string ret(str); delete[] str; - return std::string (str); + return ret; } void PrivateKeys::Sign (const uint8_t * buf, int len, uint8_t * signature) const