Module: kamailio
Branch: master
Commit: 740cfa0ebed20ba7b5ae2cab1b25aa2f6cd83899
URL:
https://github.com/kamailio/kamailio/commit/740cfa0ebed20ba7b5ae2cab1b25aa2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-07-24T12:30:58+02:00
siptrace: safety check if db connection is set
- reported in GH #262
---
Modified: modules/siptrace/siptrace.c
---
Diff:
https://github.com/kamailio/kamailio/commit/740cfa0ebed20ba7b5ae2cab1b25aa2…
Patch:
https://github.com/kamailio/kamailio/commit/740cfa0ebed20ba7b5ae2cab1b25aa2…
---
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;