aboutsummaryrefslogtreecommitdiff
path: root/src/utility.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-06-02 00:01:11 +0300
committerPerttu Ahola <celeron55@gmail.com>2011-06-02 00:01:11 +0300
commit51cf464f7450ee31e3a986b521f90cc6195bb2fb (patch)
tree8ba28ebba364d3505c946e987c2169912cc153c4 /src/utility.cpp
parentbbead93c1a00a1c31956e12c94717f179ac5b84b (diff)
downloadminetest-51cf464f7450ee31e3a986b521f90cc6195bb2fb.tar.gz
minetest-51cf464f7450ee31e3a986b521f90cc6195bb2fb.tar.bz2
minetest-51cf464f7450ee31e3a986b521f90cc6195bb2fb.zip
Fixed the password crash on Windows
Diffstat (limited to 'src/utility.cpp')
-rw-r--r--src/utility.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utility.cpp b/src/utility.cpp
index 186881c5a..0721100cb 100644
--- a/src/utility.cpp
+++ b/src/utility.cpp
@@ -229,10 +229,10 @@ std::string translatePassword(std::string playername, std::wstring password)
if(password.length() == 0)
return "";
- std::string slt=playername + wide_to_narrow(password);
- SHA1 *sha1 = new SHA1();
- sha1->addBytes(slt.c_str(), slt.length());
- unsigned char *digest = sha1->getDigest();
+ std::string slt = playername + wide_to_narrow(password);
+ SHA1 sha1;
+ sha1.addBytes(slt.c_str(), slt.length());
+ unsigned char *digest = sha1.getDigest();
std::string pwd = base64_encode(digest, 20);
free(digest);
return pwd;