summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2012-02-27 11:23:34 -0500
committerAndy Schwerin <schwerin@10gen.com>2012-04-19 17:28:36 -0400
commit1911459b0dd643506afe9f0280288090fa123a06 (patch)
tree4d1d0e9070ee1fbd3418fbc172c9f03e21ffa975
parent5f4961309049c5bef3b8669e7972a19d52ec85d3 (diff)
downloadmongo-1911459b0dd643506afe9f0280288090fa123a06.tar.gz
SERVER-5093 fix logic error to avoid memory corruption.
-rw-r--r--s/config.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/s/config.cpp b/s/config.cpp
index 8887c61a03b..0f5aaf1b2c1 100644
--- a/s/config.cpp
+++ b/s/config.cpp
@@ -215,14 +215,13 @@ namespace mongo {
{
scoped_lock lk( _lock );
- CollectionInfo& ci = _collections[ns];
-
- bool earlyReload = ! ci.isSharded() && ( shouldReload || forceReload );
+ bool earlyReload = ! _collections[ns].isSharded() && ( shouldReload || forceReload );
if ( earlyReload ) {
// this is to catch cases where there this is a new sharded collection
_reload();
- ci = _collections[ns];
}
+
+ CollectionInfo& ci = _collections[ns];
massert( 10181 , (string)"not sharded:" + ns , ci.isSharded() );
assert( ! ci.key().isEmpty() );