From 8d0cb2e8754f3c19939e1faf2080f56d2bf8836c Mon Sep 17 00:00:00 2001 From: Palakis Date: Mon, 24 Apr 2017 11:01:11 +0200 Subject: [PATCH] Auth: free string after use --- Config.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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()