Permalink
Browse files

Fix segfault when logout command runs on a database with no authentic…

…ated users.
  • Loading branch information...
amschwerin committed Dec 14, 2012
1 parent e447071 commit 03f35f2815726130ff69d63b7d6ba20b2208ebed
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/mongo/db/auth/authorization_manager.cpp
@@ -198,6 +198,8 @@ namespace mongo {
void AuthorizationManager::logoutDatabase(const std::string& dbname) {
Principal* principal = _authenticatedPrincipals.lookupByDBName(dbname);
+ if (!principal)
+ return;
_acquiredPrivileges.revokePrivilegesFromPrincipal(principal->getName());
_authenticatedPrincipals.removeByDBName(dbname);
}

0 comments on commit 03f35f2

Please sign in to comment.