Ver Fonte

textops: free result of subst transformation when is larger than target buffer

Daniel-Constantin Mierla há 12 anos atrás
pai
commit
6a51d9e87a
1 ficheiros alterados com 2 adições e 0 exclusões
  1. 2 0
      modules/textops/txt_var.c

+ 2 - 0
modules/textops/txt_var.c

@@ -94,6 +94,8 @@ int tr_txt_eval_re(struct sip_msg *msg, tr_param_t *tp, int subtype,
 			{
 				LM_ERR("subst result too big %d, increase buffer size\n",
 						result->len);
+				pkg_free(result->s);
+				pkg_free(result);
 				goto error;
 			}
 			memcpy(tr_txt_buf, result->s, result->len);