Change-Id: I5720ea4c4a237eca7aac19e2cdf7a37194c4c69c
Signed-off-by: Radoslaw Jablonski <radoslawx.jablonski@intel.com>
if (n > 0) {
int *domids;
/* Get list of domains. */
if (n > 0) {
int *domids;
/* Get list of domains. */
- domids = malloc(sizeof(*domids) * n);
+ domids = calloc(n, sizeof(*domids));
- ERROR(PLUGIN_NAME " plugin: malloc failed.");
+ ERROR(PLUGIN_NAME " plugin: calloc failed.");
return -1;
}
n = virConnectListDomains(conn, domids, n);
return -1;
}
n = virConnectListDomains(conn, domids, n);
int *domids;
/* Get list of domains. */
int *domids;
/* Get list of domains. */
- domids = malloc(sizeof(*domids) * n);
+ domids = calloc(n, sizeof(*domids));
- ERROR(PLUGIN_NAME " plugin: malloc failed.");
+ ERROR(PLUGIN_NAME " plugin: calloc failed.");