[sr-dev] git:master:f0b5fa74: tsilo: init and safety check for t value before unref

Daniel-Constantin Mierla miconda at gmail.com
Tue Dec 29 23:49:27 CET 2015


Module: kamailio
Branch: master
Commit: f0b5fa7415d81cfc6df1e4dd51cd508898df5419
URL: https://github.com/kamailio/kamailio/commit/f0b5fa7415d81cfc6df1e4dd51cd508898df5419

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-12-29T23:48:39+01:00

tsilo: init and safety check for t value before unref

---

Modified: modules/tsilo/ts_append.c

---

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

---

diff --git a/modules/tsilo/ts_append.c b/modules/tsilo/ts_append.c
index 3c47663..db47fdf 100644
--- a/modules/tsilo/ts_append.c
+++ b/modules/tsilo/ts_append.c
@@ -82,7 +82,7 @@ int ts_append(struct sip_msg* msg, str *ruri, char *table) {
 }
 
 int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str *uri) {
-	struct cell     *t;
+	struct cell     *t=0;
 	struct cell     *orig_t;
 	struct sip_msg *orig_msg;
 	int ret;
@@ -130,7 +130,7 @@ int ts_append_to(struct sip_msg* msg, int tindex, int tlabel, char *table, str *
 done:
 	/* unref the transaction which had been referred by t_lookup_ident() call. 
 	 * Restore the original transaction (if any) */
-	_tmb.unref_cell(t);
+	if(t) _tmb.unref_cell(t);
 	_tmb.t_sett(orig_t, T_BR_UNDEFINED);
 	
 	return ret;




More information about the sr-dev mailing list