This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Typemap.xs: avoid leak
[perl5.git] / ext / XS-Typemap / Typemap.xs
index 16731b1..1c54d1a 100644 (file)
@@ -203,9 +203,9 @@ XS_unpack_anotherstructPtrPtr(SV *in)
 void
 XS_release_anotherstructPtrPtr(anotherstruct **in)
 {
-    unsigned int i = 0;
-    while (in[i] != NULL)
-        Safefree(in[i++]);
+    unsigned int i;
+    for (i = 0; in[i] != NULL; i++)
+        Safefree(in[i]);
     Safefree(in);
 }