[libvirt] [PATCH REPOST 2/6] tests: Fix possible NULL deref