]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - Magic.xs
Fix memory miswrite when passing data arguments to cast()
[perl/modules/Variable-Magic.git] / 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