[sr-dev] git:5.1:a792b1cf: siptrace: check if trace_to_database is set before checking the db connection
Federico Cabiddu
federico.cabiddu at gmail.com
Tue Aug 27 09:28:27 CEST 2019
Module: kamailio
Branch: 5.1
Commit: a792b1cfd927e1c29385a229d82b96c91b86b9ab
URL: https://github.com/kamailio/kamailio/commit/a792b1cfd927e1c29385a229d82b96c91b86b9ab
Author: Federico Cabiddu <federico.cabiddu at gmail.com>
Committer: Federico Cabiddu <federico.cabiddu at gmail.com>
Date: 2019-08-27T09:28:12+02:00
siptrace: check if trace_to_database is set before checking the db connection
(cherry picked from commit afd0c929dc72a975e2ca3c88f307fd8c140a4fda)
---
Modified: src/modules/siptrace/siptrace.c
---
Diff: https://github.com/kamailio/kamailio/commit/a792b1cfd927e1c29385a229d82b96c91b86b9ab.diff
Patch: https://github.com/kamailio/kamailio/commit/a792b1cfd927e1c29385a229d82b96c91b86b9ab.patch
---
diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 1e26bc2131..59c14d7b7e 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -503,14 +503,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];
More information about the sr-dev
mailing list