Skip to content

Commit a099743

Browse files
committed
CDRIVER-745 crash in _mongoc_cluster_disconnect_node
In _mongoc_cluster_node_destroy, don't NULL the node->tags bson. Reinitialize it instead, so it can be safely destroyed again if the node is reused and disconnected.
1 parent d419295 commit a099743

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mongoc/mongoc-cluster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ _mongoc_cluster_node_destroy (mongoc_cluster_node_t *node)
329329

330330
if (node->tags.len) {
331331
bson_destroy (&node->tags);
332-
memset (&node->tags, 0, sizeof node->tags);
332+
bson_init (&node->tags);
333333
}
334334

335335
bson_free (node->replSet);

0 commit comments

Comments
 (0)