virshCheckpointListCollect: Do not pass NULL to qsort

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-04-19 13:54:15 +02:00 committed by Laine Stump
parent 89ce1ef86b
commit 1c34211c22

View File

@ -628,7 +628,8 @@ virshCheckpointListCollect(vshControl *ctl,
}
}
if (!(orig_flags & VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL))
if (!(orig_flags & VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL) &&
checkpointlist->chks)
qsort(checkpointlist->chks, checkpointlist->nchks,
sizeof(*checkpointlist->chks), virshChkSorter);