Skip to content

Commit 62f3e0c

Browse files
committed
fix: add early NULL return in _mongoc_cluster_stream_for_server
1 parent cef7db2 commit 62f3e0c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/libmongoc/src/mongoc/mongoc-cluster.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2278,9 +2278,11 @@ _mongoc_cluster_stream_for_server (mongoc_cluster_t *cluster,
22782278
}
22792279
bson_mutex_unlock (&topology->mutex);
22802280
_mongoc_bson_init_with_transient_txn_error (cs, reply);
2281+
return NULL;
22812282
}
22822283

2283-
/* If this is a load balanced topology and the server stream does not have a service id, disconnect and return an error. */
2284+
/* If this is a load balanced topology and the server stream does not have a
2285+
* service id, disconnect and return an error. */
22842286
bson_mutex_lock (&topology->mutex);
22852287
if (topology->description.type == MONGOC_TOPOLOGY_LOAD_BALANCED) {
22862288
bson_oid_t service_id;

0 commit comments

Comments
 (0)