mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
perl: Stop using the safe_malloc, etc. functions.
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user