diff --git a/src/virt.c b/src/virt.c
index 79d46826997d2222590839769137a0ea28155c34..e5a8725381d2cf56a7e3e4ea01ddff6481276d82 100644 (file)
--- a/src/virt.c
+++ b/src/virt.c
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;
}