Skip to content

Commit a22bb06

Browse files
authored
CDRIVER-4774 fix data race in mongoc_cursor_get_host (#1468)
1 parent 647375c commit a22bb06

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

NEWS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
libmongoc 1.25.1 (Unreleased)
1+
libmongoc 1.25.2 (Unreleased)
22
=============================
33

4+
Fixes:
5+
6+
* Fix data race in `mongoc_cursor_get_host`.
7+
8+
libmongoc 1.25.1
9+
================
10+
411
Fixes:
512

613
* Add back support for `BUILD_VERSION` CMake option. `BUILD_VERSION` was unintentionally removed in 1.25.0.

src/libbson/NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
libbson 1.25.2 (Unreleased)
2+
===========================
3+
4+
TODO: Add news.
5+
16
libbson 1.25.1
27
==============
38

src/libmongoc/src/mongoc/mongoc-cursor.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,12 +1370,10 @@ mongoc_cursor_get_host (mongoc_cursor_t *cursor, mongoc_host_list_t *host)
13701370
td = mc_tpld_take_ref (cursor->client->topology);
13711371
description = mongoc_topology_description_server_by_id_const (
13721372
td.ptr, cursor->server_id, &cursor->error);
1373-
mc_tpld_drop_ref (&td);
1374-
if (!description) {
1375-
return;
1373+
if (description) {
1374+
*host = description->host;
13761375
}
1377-
1378-
*host = description->host;
1376+
mc_tpld_drop_ref (&td);
13791377

13801378
EXIT;
13811379
}

0 commit comments

Comments
 (0)