perl: Stop using the safe_malloc, etc. functions.

This commit is contained in:
Richard W.M. Jones
2016-02-05 13:35:29 +00:00
parent 2a48a6591f
commit 4b96331ad5

View File

@@ -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";