Переглянути джерело

modules/tsilo: return from ts_store if transaction is not defined

grumvalski 10 роки тому
батько
коміт
e7dc20f48c
2 змінених файлів з 6 додано та 1 видалено
  1. 1 1
      modules/tsilo/ts_hash.c
  2. 5 0
      modules/tsilo/ts_store.c

+ 1 - 1
modules/tsilo/ts_hash.c

@@ -297,7 +297,7 @@ void remove_ts_urecord(ts_urecord_t* _r)
 int insert_ts_transaction(struct cell* t, struct sip_msg* msg, struct ts_urecord* _r)
 {
 	ts_transaction_t *ptr, *prev;
-        ts_transaction_t* ts;
+    ts_transaction_t* ts;
 
 	unsigned int tindex;
 	unsigned int tlabel;

+ 5 - 0
modules/tsilo/ts_store.c

@@ -46,6 +46,11 @@ int ts_store(struct sip_msg* msg) {
 	t = _tmb.t_gett();
 	ruri = msg->first_line.u.request.uri;
 
+	if (!t || t==T_UNDEFINED) {
+		LM_ERR("no transaction defined for %.*s\n", ruri.len, ruri.s);
+		return -1;
+	}
+	
 	LM_DBG("storing transaction %u:%u for r-uri: %.*s\n", t->hash_index, t->label, ruri.len, ruri.s);
 
 	lock_entry_by_ruri(&ruri);