Module: kamailio
Branch: master
Commit: afd0c929dc72a975e2ca3c88f307fd8c140a4fda
URL:
https://github.com/kamailio/kamailio/commit/afd0c929dc72a975e2ca3c88f307fd8…
Author: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Committer: Federico Cabiddu <federico.cabiddu(a)gmail.com>
Date: 2019-08-26T20:21:13+02:00
siptrace: check if trace_to_database is set before checking the db connection
---
Modified: src/modules/siptrace/siptrace.c
---
Diff:
https://github.com/kamailio/kamailio/commit/afd0c929dc72a975e2ca3c88f307fd8…
Patch:
https://github.com/kamailio/kamailio/commit/afd0c929dc72a975e2ca3c88f307fd8…
---
diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 8fa832a043..211ddac363 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -542,14 +542,14 @@ static int sip_trace_store(siptrace_data_t *sto, dest_info_t *dst,
static int sip_trace_store_db(siptrace_data_t *sto)
{
+ if(trace_to_database_flag == NULL || *trace_to_database_flag == 0)
+ goto done;
+
if(db_con == NULL) {
LM_DBG("database connection not initialized\n");
return -1;
}
- if(trace_to_database_flag == NULL || *trace_to_database_flag == 0)
- goto done;
-
db_key_t db_keys[NR_KEYS];
db_val_t db_vals[NR_KEYS];