From 5aa2ed265f80664f57073213b17c83b1dac42ab4 Mon Sep 17 00:00:00 2001 From: Chris Double Date: Wed, 23 Sep 2015 20:48:56 +1200 Subject: [PATCH] textops: prevent null dereference on tr_txt_eval_re error - Check for NULL pointer before calling subst_expr_free to prevent NULL pointer dereference when there is an unknown subtype error. --- modules/textops/txt_var.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/textops/txt_var.c b/modules/textops/txt_var.c index 0f704e37cdb..41201f74eac 100644 --- a/modules/textops/txt_var.c +++ b/modules/textops/txt_var.c @@ -124,7 +124,7 @@ int tr_txt_eval_re(struct sip_msg *msg, tr_param_t *tp, int subtype, return 0; error: - if (tp->type == TR_PARAM_SPEC) { + if (tp->type == TR_PARAM_SPEC && se!=NULL) { subst_expr_free(se); } return -1;