Module: kamailio
Branch: master
Commit: afebe6b2e597755ae37fd37bdf011fbb2fbbf8fe
URL:
https://github.com/kamailio/kamailio/commit/afebe6b2e597755ae37fd37bdf011fb…
Author: aelezovic <adnan.elezovic(a)infobip.com>
Committer: Victor Seva <linuxmaniac(a)torreviejawireless.org>
Date: 2024-10-09T16:15:31+02:00
mongodb: fix cursor error resulting empty result set
---
Modified: src/modules/db_mongodb/mongodb_dbase.c
---
Diff:
https://github.com/kamailio/kamailio/commit/afebe6b2e597755ae37fd37bdf011fb…
Patch:
https://github.com/kamailio/kamailio/commit/afebe6b2e597755ae37fd37bdf011fb…
---
diff --git a/src/modules/db_mongodb/mongodb_dbase.c
b/src/modules/db_mongodb/mongodb_dbase.c
index 6b51962c8b8..a57324d4afa 100644
--- a/src/modules/db_mongodb/mongodb_dbase.c
+++ b/src/modules/db_mongodb/mongodb_dbase.c
@@ -838,6 +838,7 @@ static int db_mongodb_store_result(const db1_con_t *_h, db1_res_t
**_r)
|| !mongoc_cursor_next(mgres->cursor, &itdoc) || !itdoc) {
if(mongoc_cursor_error(mgres->cursor, &error)) {
LM_DBG("An error occurred: %s\n", error.message);
+ goto error;
} else {
LM_DBG("no result from mongodb\n");
}