We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7aea300 commit 53bc92dCopy full SHA for 53bc92d
Sources/MongoSwift/ClientSession.swift
@@ -94,8 +94,11 @@ public final class ClientSession {
94
return nil
95
}
96
return connection.withMongocConnection { client in
97
- let serverDescription =
98
- ServerDescription(mongoc_client_get_server_description(client, serverID))
+ guard let sd = mongoc_client_get_server_description(client, serverID) else {
+ return nil
99
+ }
100
+ defer { mongoc_server_description_destroy(sd) }
101
+ let serverDescription = ServerDescription(sd)
102
return serverDescription.address
103
104
0 commit comments