diff --git a/src/virt.c b/src/virt.c
index 79d46826997d2222590839769137a0ea28155c34..16bb77b101505cdd592977736248be540148cf1d 100644 (file)
--- a/src/virt.c
+++ b/src/virt.c
continue;
}
- status = virDomainMemoryStats (domains[i], minfo, VIR_DOMAIN_MEMORY_STAT_NR, 0);
+ status = virDomainMemoryStats (domains[i], minfo, VIR_DOMAIN_MEMORY_STAT_NR, 0);
if (status < 0) {
ERROR ("virt plugin: virDomainMemoryStats failed with status %i.",
int *domids;
/* Get list of domains. */
- domids = malloc (sizeof (int) * n);
- if (domids == 0) {
+ domids = malloc (sizeof (*domids) * n);
+ if (domids == NULL) {
ERROR (PLUGIN_NAME " plugin: malloc failed.");
return -1;
}