summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-08-21 17:06:10 -0400
committerEliot Horowitz <eliot@10gen.com>2012-08-21 17:37:45 -0400
commita0698e7f385e867469ac8feeb4c8e12e732d630b (patch)
treee25c53560c9cd0bf0ecde3320760cd5b126e8875
parent3c7061b50bcbd66c864da8771ddb3f77823008f9 (diff)
downloadmongo-a0698e7f385e867469ac8feeb4c8e12e732d630b.tar.gz
SERVER-6814 - fix memory leak in BtreeCursor::make
-rw-r--r--src/mongo/db/btreecursor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mongo/db/btreecursor.cpp b/src/mongo/db/btreecursor.cpp
index 9d423eb80b3..870282f4f20 100644
--- a/src/mongo/db/btreecursor.cpp
+++ b/src/mongo/db/btreecursor.cpp
@@ -221,20 +221,20 @@ namespace mongo {
NamespaceDetails *d, int idxNo, const IndexDetails& id,
const BSONObj &startKey, const BSONObj &endKey, bool endKeyInclusive, int direction)
{
- BtreeCursor *c = make( d , idxNo , id );
+ auto_ptr<BtreeCursor> c( make( d , idxNo , id ) );
c->init(startKey,endKey,endKeyInclusive,direction);
c->initWithoutIndependentFieldRanges();
dassert( c->_dups.size() == 0 );
- return c;
+ return c.release();
}
BtreeCursor* BtreeCursor::make(
NamespaceDetails *d, int idxNo, const IndexDetails& id,
const shared_ptr< FieldRangeVector > &bounds, int singleIntervalLimit, int direction )
{
- BtreeCursor *c = make( d , idxNo , id );
+ auto_ptr<BtreeCursor> c( make( d , idxNo , id ) );
c->init(bounds,singleIntervalLimit,direction);
- return c;
+ return c.release();
}
BtreeCursor::BtreeCursor( NamespaceDetails* nsd , int theIndexNo, const IndexDetails& id )