Module: kamailio Branch: master Commit: afebe6b2e597755ae37fd37bdf011fbb2fbbf8fe URL: https://github.com/kamailio/kamailio/commit/afebe6b2e597755ae37fd37bdf011fbb...
Author: aelezovic adnan.elezovic@infobip.com Committer: Victor Seva linuxmaniac@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/afebe6b2e597755ae37fd37bdf011fbb... Patch: https://github.com/kamailio/kamailio/commit/afebe6b2e597755ae37fd37bdf011fbb...
---
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"); }