diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-02-01 21:19:10 +0100 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2026-02-01 21:57:59 +0100 |
| commit | 4e196af17c334de1eb74f7bb036fec12a35b794e (patch) | |
| tree | 65335f9d7441487bd1bc4846fdb4f1c4f44c775b /re.c | |
| parent | a93604b5ed813c43aca572ad64c1a7b66b715429 (diff) | |
Use ruby_sized_xfree
Diffstat (limited to 're.c')
| -rw-r--r-- | re.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1023,7 +1023,7 @@ update_char_offset(VALUE match) num_regs = rm->regs.num_regs; if (rm->char_offset_num_allocated < num_regs) { - REALLOC_N(rm->char_offset, struct rmatch_offset, num_regs); + SIZED_REALLOC_N(rm->char_offset, struct rmatch_offset, num_regs, rm->char_offset_num_allocated); rm->char_offset_num_allocated = num_regs; } @@ -1101,7 +1101,7 @@ match_init_copy(VALUE obj, VALUE orig) if (RMATCH_EXT(orig)->char_offset_num_allocated) { if (rm->char_offset_num_allocated < rm->regs.num_regs) { - REALLOC_N(rm->char_offset, struct rmatch_offset, rm->regs.num_regs); + SIZED_REALLOC_N(rm->char_offset, struct rmatch_offset, rm->regs.num_regs, rm->char_offset_num_allocated); rm->char_offset_num_allocated = rm->regs.num_regs; } MEMCPY(rm->char_offset, RMATCH_EXT(orig)->char_offset, |
