diff options
author | Chip Salzenberg <chip@perl.com> | 1997-01-31 20:56:47 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-02-04 17:47:00 +1200 |
commit | 49beac4814c9f4f107819fdd49700d8c7d84d40b (patch) | |
tree | 68f817e0b01bdfc68682793fb3f49b3e347575a5 /av.c | |
parent | 0a051f4f5e731bb47ed1e4d5a583f98a0d519501 (diff) | |
download | perl-49beac4814c9f4f107819fdd49700d8c7d84d40b.tar.gz |
Fix scalar leak in av_unshift
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -199,9 +199,8 @@ SV *val; croak(no_modify); if (key > AvMAX(av)) av_extend(av,key); - if (AvREIFY(av)) + if (!AvREAL(av) && AvREIFY(av)) av_reify(av); - ary = AvARRAY(av); if (AvFILL(av) < key) { if (!AvREAL(av)) { @@ -385,12 +384,8 @@ register I32 num; return; if (SvREADONLY(av)) croak(no_modify); - if (!AvREAL(av)) { - if (AvREIFY(av)) - av_reify(av); - else - croak("Can't unshift"); - } + if (!AvREAL(av) && AvREIFY(av)) + av_reify(av); i = AvARRAY(av) - AvALLOC(av); if (i) { if (i > num) |