cmdDomBlkError: Fix crash when initial call to virDomainGetDiskErrors fails
cmdDomBlkError: Fix crash when initial call to virDomainGetDiskErrors fails

virDomainGetDiskErrors uses the weird semantics where we make the
caller query for the number of elements and then pass pre-allocated
structure.

The cleanup section errorneously used the 'count' variable to free the
allocated elements for the API but 'count' can be '-1' in cases when the
API returns failure, thus attempting to free beyond the end of the
array.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/155
Signed-off-by: Peter Krempa <2cf5c04c61aa466e4a47bfedc747d17279c72ffc@redhat.com>
Reviewed-by: Pavel Hrdina <d4772d05997b8abf035041e3b4f4996380ea7e7a@redhat.com>

jfehlig/libvirt,olafhering/libvirt,zippy2/libvirt,libvirt/libvirt,zippy2/libvirt,zippy2/libvirt,olafhering/libvirt,crobinso/libvirt,nertpinx/libvirt,crobinso/libvirt,olafhering/libvirt,olafhering/libvirt,nertpinx/libvirt,libvirt/libvirt,nertpinx/libvirt,jfehlig/libvirt,jfehlig/libvirt,libvirt/libvirt,jfehlig/libvirt,zippy2/libvirt,nertpinx/libvirt,nertpinx/libvirt,libvirt/libvirt,crobinso/libvirt,crobinso/libvirt