diff options
author | Hugo van der Sanden <hv@crypt.org> | 2017-02-28 11:23:09 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-03-15 09:17:08 +0000 |
commit | 00195859c65eccf9425faf45db543a12c7ad3874 (patch) | |
tree | cd04c70326c16ed06553a6608564bd8237b888b6 /pp_sort.c | |
parent | acfc2cc32784cce84bd781bc3822b14406b94db2 (diff) | |
download | perl-00195859c65eccf9425faf45db543a12c7ad3874.tar.gz |
update size after Renew
RT #130841
In general code, change this idiom:
PL_foo_max += size;
Renew(PL_foo, PL_foo_max, foo_t);
to
Renew(PL_foo, PL_foo_max + size, foo_t);
PL_foo_max += size;
so that if Renew dies, PL_foo_max won't be left hanging.
Diffstat (limited to 'pp_sort.c')
-rw-r--r-- | pp_sort.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1831,8 +1831,8 @@ S_sortcv_stacked(pTHX_ SV *const a, SV *const b) AvARRAY(av) = ary; } if (AvMAX(av) < 1) { - AvMAX(av) = 1; Renew(ary,2,SV*); + AvMAX(av) = 1; AvARRAY(av) = ary; AvALLOC(av) = ary; } |