---
generator/perl.ml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/generator/perl.ml b/generator/perl.ml
index 240bf3b54..5fa00a92d 100644
--- a/generator/perl.ml
+++ b/generator/perl.ml
@@ -122,8 +122,10 @@ XS_unpack_charPtrPtr (SV *arg) {
for (i = 0; i <= av_len (av); i++) {
SV **elem = av_fetch (av, i, 0);
- if (!elem || !*elem)
+ if (!elem || !*elem) {
+ free (ret);
croak (\"missing element in list\");
+ }
ret[i] = SvPV_nolen (*elem);
}
--
2.13.2