]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virshCheckpointListCollect: Do not pass NULL to qsort
authorTim Wiederhake <twiederh@redhat.com>
Mon, 19 Apr 2021 11:54:15 +0000 (13:54 +0200)
committerLaine Stump <laine@redhat.com>
Mon, 19 Apr 2021 20:09:56 +0000 (16:09 -0400)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
tools/virsh-checkpoint.c

index afe849dd16ed914e4d53f25aa31616274e1e71e7..e88f9ffb474bf7bc2c95b9b3b506919cea736ef5 100644 (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);