X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Futility.cpp;h=0721100cb98e845871e033aaf5920fcb9a624a14;hb=30c34cc23e9a060ef964854038a314a94ad5cbae;hp=186881c5acc2ba59a794301f457248a202a2a4d4;hpb=e1a2b8f600ff9845ecff0f06c85d4d2c29970414;p=dragonfireclient.git 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;