From f0b5fa7415d81cfc6df1e4dd51cd508898df5419 Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Tue, 29 Dec 2015 23:48:39 +0100 Subject: [PATCH] tsilo: init and safety check for t value before unref --- modules/tsilo/ts_append.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tsilo/ts_append.c b/modules/tsilo/ts_append.c index 3c476630da7..db47fdfad7d 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;