]> git.vpit.fr Git - perl/modules/Variable-Magic.git/commitdiff
Fix memory miswrite when passing data arguments to cast()
authorVincent Pit <vince@profvince.com>
Mon, 28 Dec 2009 18:12:46 +0000 (19:12 +0100)
committerVincent Pit <vince@profvince.com>
Mon, 28 Dec 2009 18:19:01 +0000 (19:19 +0100)
Magic.xs

index 183bfbd7521bfe193b2085d9b299315df5db4ef8..537f1e2e24dd19cc5731f4301bff1e9a76c12cd2 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -1414,15 +1414,12 @@ PROTOTYPE: \[$@%&*]$@
 PREINIT:
  SV **args = NULL;
  I32 i = 0;
- SV *ret;
 CODE:
  if (items > 2) {
   i = items - 2;
   args = &ST(2);
  }
- ret = newSVuv(vmg_cast(SvRV(sv), vmg_wizard_validate(wiz), args, i));
- SvREFCNT_dec(args);
- RETVAL = ret;
+ RETVAL = newSVuv(vmg_cast(SvRV(sv), vmg_wizard_validate(wiz), args, i));
 OUTPUT:
  RETVAL