summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-03-09 10:22:53 -0500
committerEliot Horowitz <eliot@10gen.com>2011-03-09 10:23:51 -0500
commit3bc93cc5dcdd511739bc729b8b77927b2f4b9429 (patch)
tree7285d00c4cdc4fd7e82487e70c7d86ecad3261fd
parent2bc1b84422be1053b984d05d61869781284ae486 (diff)
downloadmongo-3bc93cc5dcdd511739bc729b8b77927b2f4b9429.tar.gz
fix potential seg fault when Client Context isn't handled correct with exceptions
-rw-r--r--db/client.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/db/client.cpp b/db/client.cpp
index 7445ecacb55..e4fd4b9dddc 100644
--- a/db/client.cpp
+++ b/db/client.cpp
@@ -169,11 +169,6 @@ namespace mongo {
uassert( 13005 , "can't create db, keeps getting closed" , _db );
}
- _client->_context = this;
- _client->_curOp->enter( this );
- if ( doauth )
- _auth( lockState );
-
switch ( _client->_curOp->getOp() ) {
case dbGetMore: // getMore's are special and should be handled else where
case dbUpdate: // update & delete check shard version in instance.cpp, so don't check here as well
@@ -188,6 +183,11 @@ namespace mongo {
}
}
}
+
+ _client->_context = this;
+ _client->_curOp->enter( this );
+ if ( doauth )
+ _auth( lockState );
}
void Client::Context::_auth( int lockState ) {