Explorar el Código

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

Daniel-Constantin Mierla hace 12 años
padre
commit
6a51d9e87a
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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);