diff --git a/src/common/NebulaUtil.cc b/src/common/NebulaUtil.cc index 40e6418fb8..245ce24c24 100644 --- a/src/common/NebulaUtil.cc +++ b/src/common/NebulaUtil.cc @@ -271,6 +271,7 @@ string * one_util::aes256cbc_decrypt(const string& in, const string& password) if (!crypted || crypted->empty()) { + delete crypted; return nullptr; } @@ -305,6 +306,8 @@ string * one_util::aes256cbc_decrypt(const string& in, const string& password) EVP_CIPHER_CTX_free(ctx); #endif + delete crypted; + if (!success) { return nullptr;