diff options
Diffstat (limited to 's/shardconnection.cpp')
-rw-r--r-- | s/shardconnection.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/s/shardconnection.cpp b/s/shardconnection.cpp index dff828a0d39..b759284f94a 100644 --- a/s/shardconnection.cpp +++ b/s/shardconnection.cpp @@ -105,7 +105,13 @@ namespace mongo { if ( s->avail ) { DBClientBase* c = s->avail; s->avail = 0; - shardConnectionPool.onHandedOut( c ); + try { + shardConnectionPool.onHandedOut( c ); + } + catch ( std::exception& ) { + delete c; + throw; + } return c; } |