-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 0.7.1
-
Component/s: None
-
None
The function mongo_cursor_get_more() should not call mongo_cursor_destroy(),
because then it's impossible to know whether this should be done in the client,
since all paths just result in MONGO_ERROR being returned.
Diff, which includes the incorrect bson_free mentioned in ticket CDRIVER-208:
diff --git a/src/mongo.c b/src/mongo.c
index c8df093..3487488 100644
— a/src/mongo.c
+++ b/src/mongo.c
@@ -1269,16 +1269,13 @@ static int mongo_cursor_get_more( mongo_cursor *cursor ) {
data = mongo_data_append32( data, &limit );
mongo_data_append64( data, &cursor->reply->fields.cursorID );
- bson_free( cursor->reply );
res = mongo_message_send( cursor->conn, mm );
if( res != MONGO_OK ) { - mongo_cursor_destroy( cursor ); return MONGO_ERROR; }
res = mongo_read_response( cursor->conn, &( cursor->reply ) );
if( res != MONGO_OK ) {- mongo_cursor_destroy( cursor ); return MONGO_ERROR; }cursor->current.data = NULL;