---
generator/perl.ml | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/generator/perl.ml b/generator/perl.ml
index cec7fb7..6876b0f 100644
--- a/generator/perl.ml
+++ b/generator/perl.ml
@@ -176,7 +176,8 @@ get_all_event_callbacks (guestfs_h *g, size_t *len_rtn)
}
/* Copy them into the return array. */
- r = guestfs_int_safe_malloc (g, sizeof (SV *) * (*len_rtn));
+ r = malloc (sizeof (SV *) * (*len_rtn));
+ if (r == NULL) croak (\"malloc: %%m\");
i = 0;
cb = guestfs_first_private (g, &key);
@@ -477,7 +478,8 @@ PREINIT:
pr " /* Note av_len returns index of final element.
*/\n";
pr " len = av_len (av) + 1;\n";
pr "\n";
- pr " r = guestfs_int_safe_malloc (g, (len+1) * sizeof (char
*));\n";
+ pr " r = malloc ((len+1) * sizeof (char *));\n";
+ pr " if (r == NULL) croak (\"malloc:
%%m\");\n";
pr " for (i = 0; i < len; ++i) {\n";
pr " svp = av_fetch (av, i, 0);\n";
pr " r[i] = SvPV_nolen (*svp);\n";
--
2.5.0