Module: kamailio
Branch: master
Commit: 9a8974a80b8ce5ffc9166e81f43f8581777cd48f
URL:
https://github.com/kamailio/kamailio/commit/9a8974a80b8ce5ffc9166e81f43f858…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-04-13T17:05:18+02:00
htable: check if entries are initialized before sync'ing to db
---
Modified: src/modules/htable/ht_db.c
---
Diff:
https://github.com/kamailio/kamailio/commit/9a8974a80b8ce5ffc9166e81f43f858…
Patch:
https://github.com/kamailio/kamailio/commit/9a8974a80b8ce5ffc9166e81f43f858…
---
diff --git a/src/modules/htable/ht_db.c b/src/modules/htable/ht_db.c
index 5b9a5942ed..cbce085f6c 100644
--- a/src/modules/htable/ht_db.c
+++ b/src/modules/htable/ht_db.c
@@ -551,6 +551,11 @@ int ht_db_save_table(ht_t *ht, str *dbtable)
time_t now;
int ncols;
+ if(ht==NULL || ht->entries==NULL) {
+ LM_DBG("hash table not initialized yet\n");
+ return -1;
+ }
+
if(ht_db_con==NULL)
{
LM_ERR("no db connection\n");