diff --git a/tools/virsh.c b/tools/virsh.c index 53d1825cd75ac60461f5837fec506b6f077e9b86..85b1185887fec15db8601e405c98be109fa04e2f 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -17200,8 +17200,8 @@ vshSnapshotListCollect(vshControl *ctl, virDomainPtr dom, if (count >= 0) { /* When mixing --from and --tree, we also want a copy of from * in the list, but with no parent for that one entry. */ - snaplist->snaps = vshCalloc(ctl, sizeof(*snaplist->snaps), - count + (tree && from)); + snaplist->snaps = vshCalloc(ctl, count + (tree && from), + sizeof(*snaplist->snaps)); snaplist->nsnaps = count; for (i = 0; i < count; i++) snaplist->snaps[i].snap = snaps[i];