Module: kamailio
Branch: master
Commit: 7c9b5c8ada2933086a7665bca4aaea016a394b1f
URL:
https://github.com/kamailio/kamailio/commit/7c9b5c8ada2933086a7665bca4aaea0…
Author: Nuno Ferreira <nferreira(a)fuze.com>
Committer: Nuno Ferreira <nferreira(a)fuze.com>
Date: 2019-04-22T19:36:25+01:00
ndb_mongodb: fix initialization crash
- Initialize mongodb c driver before any other mongo api call.
Without this, kamailio would crash with a segmentation fault.
This probably won't happen if a module was also already
being used with a db_mongodb setup.
---
Modified: src/modules/ndb_mongodb/mongodb_client.c
---
Diff:
https://github.com/kamailio/kamailio/commit/7c9b5c8ada2933086a7665bca4aaea0…
Patch:
https://github.com/kamailio/kamailio/commit/7c9b5c8ada2933086a7665bca4aaea0…
---
diff --git a/src/modules/ndb_mongodb/mongodb_client.c
b/src/modules/ndb_mongodb/mongodb_client.c
index 746c5876fd..b49f111998 100644
--- a/src/modules/ndb_mongodb/mongodb_client.c
+++ b/src/modules/ndb_mongodb/mongodb_client.c
@@ -53,6 +53,7 @@ int mongodbc_init(void)
return -1;
}
+ mongoc_init();
for(rsrv=_mongodbc_srv_list; rsrv; rsrv=rsrv->next)
{
if(rsrv->uri==NULL || rsrv->uri->len<=0) {