[sr-dev] git:4.3:ba7b0eab: siptrace: safety check if db connection is set

Daniel-Constantin Mierla miconda at gmail.com
Fri Jul 24 12:33:27 CEST 2015


Module: kamailio
Branch: 4.3
Commit: ba7b0eaba0c14db6ea27190787aea25d30cfb2ca
URL: https://github.com/kamailio/kamailio/commit/ba7b0eaba0c14db6ea27190787aea25d30cfb2ca

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-07-24T12:33:06+02:00

siptrace: safety check if db connection is set

- reported in GH #262

(cherry picked from commit 740cfa0ebed20ba7b5ae2cab1b25aa2f6cd83899)

---

Modified: modules/siptrace/siptrace.c

---

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

---

diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c
index 07e3a1a..4ee8f00 100644
--- a/modules/siptrace/siptrace.c
+++ b/modules/siptrace/siptrace.c
@@ -757,6 +757,11 @@ static int sip_trace_store(struct _siptrace_data *sto, struct dest_info *dst)
 
 static int sip_trace_store_db(struct _siptrace_data *sto)
 {
+	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;
 




More information about the sr-dev mailing list