diff --git a/Config.cpp b/Config.cpp index 8fbb65a0..007908dd 100644 --- a/Config.cpp +++ b/Config.cpp @@ -167,13 +167,16 @@ bool Config::CheckAuth(const char *response) mbedtls_base64_encode(expected_response, 64, &base64_size, hash, 32); expected_response[64] = 0; // Null-terminate the string + bool authSuccess = false; if (strcmp((char*)expected_response, response) == 0) { SessionChallenge = GenerateSalt(); - return true; - } - else { - return false; + authSuccess = true; } + + bfree(challengeAndResponse); + bfree(expected_response); + + return authSuccess; } Config* Config::Current()