mirror of
https://github.com/haproxy/haproxy.git
synced 2026-02-14 16:23:38 -05:00
BUG/MINOR: sample: exit regsub() in case of trash allocation error
As reported in issue #507, since commiy 07e1e3c93e ("MINOR: sample:
regsub now supports backreferences") we must not proceed in regsub()
if we fali to allocate a trash (which in practice never happens). No
backport needed.
This commit is contained in:
parent
0f19e43f2e
commit
23997daf4e
1 changed files with 3 additions and 0 deletions
|
|
@ -2388,6 +2388,9 @@ static int sample_conv_regsub(const struct arg *arg_p, struct sample *smp, void
|
|||
break;
|
||||
|
||||
output = alloc_trash_chunk();
|
||||
if (!output)
|
||||
break;
|
||||
|
||||
output->data = exp_replace(output->area, output->size, start, arg_p[1].data.str.area, pmatch);
|
||||
|
||||
/* replace the matching part */
|
||||
|
|
|
|||
Loading…
Reference in a new issue