Module: kamailio
Branch: 4.2
Commit: 97df3a119cd4331dfd71f6e64606d3771f09aa69
URL:
https://github.com/kamailio/kamailio/commit/97df3a119cd4331dfd71f6e64606d37…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-07-29T12:38:46+02:00
siptrace: safety check if db connection is set
- reported in GH #262
(cherry picked from commit 740cfa0ebed20ba7b5ae2cab1b25aa2f6cd83899)
(cherry picked from commit ba7b0eaba0c14db6ea27190787aea25d30cfb2ca)
---
Modified: modules/siptrace/siptrace.c
---
Diff:
https://github.com/kamailio/kamailio/commit/97df3a119cd4331dfd71f6e64606d37…
Patch:
https://github.com/kamailio/kamailio/commit/97df3a119cd4331dfd71f6e64606d37…
---
diff --git a/modules/siptrace/siptrace.c b/modules/siptrace/siptrace.c
index 0ccef7d..6914d48 100644
--- a/modules/siptrace/siptrace.c
+++ b/modules/siptrace/siptrace.c
@@ -749,6 +749,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;