Browse Source

tsilo: check if tsilo hash table is still set when executing tm callback

- freeing the transaction structure by tm at shutdown can execute this
  callback, resulting in core dump (at shutdonw) if tsilo destroyed its
  hash table already
Daniel-Constantin Mierla 9 years ago
parent
commit
94da0d6488
1 changed files with 3 additions and 0 deletions
  1. 3 0
      modules/tsilo/ts_handlers.c

+ 3 - 0
modules/tsilo/ts_handlers.c

@@ -25,6 +25,7 @@
 #include "ts_handlers.h"
 #include "ts_handlers.h"
 
 
 extern struct tm_binds _tmb;
 extern struct tm_binds _tmb;
+extern struct ts_table *t_table;
 
 
 /*!
 /*!
  * \brief add transaction structure to tm callbacks
  * \brief add transaction structure to tm callbacks
@@ -61,6 +62,8 @@ void ts_onreply(struct cell* t, int type, struct tmcb_params *param)
 	ts_entry_t* _e;
 	ts_entry_t* _e;
 	ts_transaction_t *cb_ptr, *ptr;
 	ts_transaction_t *cb_ptr, *ptr;
 
 
+	if(t_table==0) return;
+
 	cb_ptr = (ts_transaction_t*)(*param->param);
 	cb_ptr = (ts_transaction_t*)(*param->param);
 	if (cb_ptr == NULL) {
 	if (cb_ptr == NULL) {
 		LM_DBG("NULL param for type %d\n", type);
 		LM_DBG("NULL param for type %d\n", type);