From: Tim Wiederhake Date: Mon, 19 Apr 2021 11:54:15 +0000 (+0200) Subject: virshCheckpointListCollect: Do not pass NULL to qsort X-Git-Tag: v7.3.0-rc1~128 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c34211c22de28127a509edbf2cf2f44cb0d891e;p=thirdparty%2Flibvirt.git virshCheckpointListCollect: Do not pass NULL to qsort Signed-off-by: Tim Wiederhake Reviewed-by: Laine Stump --- diff --git a/tools/virsh-checkpoint.c b/tools/virsh-checkpoint.c index afe849dd16..e88f9ffb47 100644 --- a/tools/virsh-checkpoint.c +++ b/tools/virsh-checkpoint.c @@ -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);