diff --git a/ChangeLog b/ChangeLog index 48d4f8fbbe..102318ee7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 16 10:30:00 GMT 2009 Daniel P. Berrange + + * qemud/remote.c: Don't allocate cpumaps arg if maplength is + 0, and fix size of cpumaps allocation + Mon Mar 16 10:30:00 GMT 2009 Daniel P. Berrange * src/storage_driver.c: Don't free storage volume in error diff --git a/qemud/remote.c b/qemud/remote.c index 8eaa7d66d8..44a274ab30 100644 --- a/qemud/remote.c +++ b/qemud/remote.c @@ -1475,7 +1475,8 @@ remoteDispatchDomainGetVcpus (struct qemud_server *server ATTRIBUTE_UNUSED, /* Allocate buffers to take the results. */ if (VIR_ALLOC_N(info, args->maxinfo) < 0) goto oom; - if (VIR_ALLOC_N(cpumaps, args->maxinfo) < 0) + if (args->maplen > 0 && + VIR_ALLOC_N(cpumaps, args->maxinfo * args->maplen) < 0) goto oom; info_len = virDomainGetVcpus (dom,