summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclientcursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/client/dbclientcursor.cpp')
-rw-r--r--src/mongo/client/dbclientcursor.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/client/dbclientcursor.cpp b/src/mongo/client/dbclientcursor.cpp
index bb74398b35f..db37bea3bf0 100644
--- a/src/mongo/client/dbclientcursor.cpp
+++ b/src/mongo/client/dbclientcursor.cpp
@@ -249,10 +249,8 @@ void DBClientCursor::commandDataReceived() {
// HACK: If we got an OP_COMMANDREPLY, take the reply object
// and shove it in to an OP_REPLY message.
if (op == dbCommandReply) {
- // Need to take ownership here as we destroy the underlying message.
- BSONObj reply = commandReply->getCommandReply().getOwned();
- batch.m.reset();
- replyToQuery(0, batch.m, reply);
+ BSONObj reply = commandReply->getCommandReply();
+ batch.m = replyToQuery(reply).response;
}
QueryResult::View qr = batch.m.singleData().view2ptr();