summaryrefslogtreecommitdiff
path: root/src/mongo/client/cyrus_sasl_client_session.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2019-02-08 17:22:52 -0500
committerHenrik Edin <henrik.edin@mongodb.com>2019-03-12 15:21:32 -0400
commitafe082642124dbda2367cb51c3d748873df9bf7b (patch)
tree0a795f2b3fc17e468c4b923357e6e803e85d818c /src/mongo/client/cyrus_sasl_client_session.cpp
parentc7e6cd6803e584a6951469e74af93ec3a7a47148 (diff)
downloadmongo-afe082642124dbda2367cb51c3d748873df9bf7b.tar.gz
SERVER-36243 Use sized deallocation.
Added mongoFree to be used when allocating memory with mongoMalloc. It has an overload taking size utilizing tc_free_sized if built with tcmalloc.
Diffstat (limited to 'src/mongo/client/cyrus_sasl_client_session.cpp')
-rw-r--r--src/mongo/client/cyrus_sasl_client_session.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mongo/client/cyrus_sasl_client_session.cpp b/src/mongo/client/cyrus_sasl_client_session.cpp
index d2201be2149..67f8d6d2b5d 100644
--- a/src/mongo/client/cyrus_sasl_client_session.cpp
+++ b/src/mongo/client/cyrus_sasl_client_session.cpp
@@ -83,6 +83,10 @@ void* saslOurRealloc(void* ptr, SaslAllocSize sz) {
return mongoRealloc(ptr, sz);
}
+void saslOurFree(void* ptr) {
+ mongoFree(ptr);
+}
+
/*
* Mutex functions to be used by the SASL library, if the client doesn't initialize the library
* for us.
@@ -111,7 +115,7 @@ void saslMutexFree(void* mutex) {
* unless the client application has previously initialized the SASL library.
*/
MONGO_INITIALIZER(CyrusSaslAllocatorsAndMutexes)(InitializerContext*) {
- sasl_set_alloc(saslOurMalloc, saslOurCalloc, saslOurRealloc, free);
+ sasl_set_alloc(saslOurMalloc, saslOurCalloc, saslOurRealloc, saslOurFree);
sasl_set_mutex(saslMutexAlloc, saslMutexLock, saslMutexUnlock, saslMutexFree);
return Status::OK();