textops: prevent null dereference on tr_txt_eval_re error 337/head
authorChris Double <chris.double@double.co.nz>
Wed, 23 Sep 2015 08:48:56 +0000 (20:48 +1200)
committerChris Double <chris.double@double.co.nz>
Wed, 23 Sep 2015 08:48:56 +0000 (20:48 +1200)
- 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

index 0f704e3..41201f7 100644 (file)
@@ -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;