[sr-dev] git:master:042971bc: Merge pull request #2047 from kamailio/grumvalski/siptrace_fix

GitHub noreply at github.com
Tue Aug 27 09:26:53 CEST 2019


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

Author: Federico Cabiddu <federico.cabiddu at gmail.com>
Committer: GitHub <noreply at github.com>
Date: 2019-08-27T09:26:48+02:00

Merge pull request #2047 from kamailio/grumvalski/siptrace_fix

siptrace: check if trace_to_database is set before checking the db co…

---

Modified: src/modules/siptrace/siptrace.c

---

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

---

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];
 




More information about the sr-dev mailing list