Permalink
Browse files

SERVER-5093 fix logic error to avoid memory corruption.

  • Loading branch information...
1 parent 5f49613 commit 1911459b0dd643506afe9f0280288090fa123a06 @milkie milkie committed with andy10gen Feb 27, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 s/config.cpp
View
@@ -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() );

0 comments on commit 1911459

Please sign in to comment.