mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
perl: Use safe_malloc instead of malloc (found by Coverity).
This commit is contained in:
@@ -458,7 +458,7 @@ user_cancel (g)
|
||||
pr " /* Note av_len returns index of final element. */\n";
|
||||
pr " len = av_len (av) + 1;\n";
|
||||
pr "\n";
|
||||
pr " r = malloc ((len+1) * sizeof (char *));\n";
|
||||
pr " r = guestfs_safe_malloc (g, (len+1) * sizeof (char *));\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