Module: kamailio
Branch: master
Commit: c8893cc05b0cabf7bde1b1a8db49bf46266632aa
URL: 
https://github.com/kamailio/kamailio/commit/c8893cc05b0cabf7bde1b1a8db49bf46266632aa

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-05-16T13:03:05+02:00

usrloc: check if database handle is initialized for db_update_ucontact_ruid()

---

Modified: src/modules/usrloc/ucontact.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/c8893cc05b0cabf7bde1b1a8db49bf46266632aa.diff
Patch: 
https://github.com/kamailio/kamailio/commit/c8893cc05b0cabf7bde1b1a8db49bf46266632aa.patch

---

diff --git a/src/modules/usrloc/ucontact.c b/src/modules/usrloc/ucontact.c
index b423d276e24..08e98c6a324 100644
--- a/src/modules/usrloc/ucontact.c
+++ b/src/modules/usrloc/ucontact.c
@@ -1000,6 +1000,11 @@ int db_update_ucontact_ruid(ucontact_t* _c)
                return -1;
        }
 
+       if (ul_dbh==NULL) {
+               LM_ERR("database connection handle not initialized\n");
+               return -1;
+       }
+
        n1 = 0;
        keys1[n1] = &ul_ruid_col;
        vals1[n1].type = DB1_STR;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to