perl: Use safe_malloc instead of malloc (found by Coverity).

This commit is contained in:
Richard W.M. Jones
2012-12-08 14:48:49 +00:00
parent 3fe5f0a971
commit a1e37b7ea5

View File

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