1
0
Fork 0

fixed memleak

This commit is contained in:
jsteemann 2017-04-27 08:54:19 +02:00
parent 3261c4ca89
commit 81c629a685
2 changed files with 4 additions and 5 deletions

View File

@ -147,9 +147,7 @@ AuthInfo::AuthInfo()
: _outdated(true),
_authJwtCache(16384),
_jwtSecret(""),
_queryRegistry(nullptr),
_authenticationHandler(nullptr) {
}
_queryRegistry(nullptr) {}
void AuthInfo::setJwtSecret(std::string const& jwtSecret) {
WRITE_LOCKER(writeLocker, _authJwtLock);
@ -245,7 +243,7 @@ void AuthInfo::reload() {
// TODO: is this correct?
if (_authenticationHandler == nullptr) {
_authenticationHandler = application_features::ApplicationServer::getFeature<AuthenticationFeature>("Authentication")->getHandler();
_authenticationHandler.reset(application_features::ApplicationServer::getFeature<AuthenticationFeature>("Authentication")->getHandler());
}
{
@ -383,6 +381,7 @@ AuthResult AuthInfo::checkPassword(std::string const& username,
if (it == _authInfo.end() || (it->second.source() == AuthSource::LDAP)) { // && it->second.created() < TRI_microtime() - 60)) {
TRI_ASSERT(_authenticationHandler != nullptr);
AuthenticationResult authResult = _authenticationHandler->authenticate(username, password);
if (!authResult.ok()) {

View File

@ -205,7 +205,7 @@ class AuthInfo {
arangodb::basics::LruCache<std::string, arangodb::AuthJwtResult> _authJwtCache;
std::string _jwtSecret;
aql::QueryRegistry* _queryRegistry;
AuthenticationHandler* _authenticationHandler;
std::unique_ptr<AuthenticationHandler> _authenticationHandler;
};
}