mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
tests: Need to check return of virGetLastError
Cannot assume virGetLastError returns non-NULL value - modify the code to fetch err and check if err && err->code Found by Coverity Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
dfb18b0afb
commit
5ddaa7ef2d
@ -60,7 +60,9 @@ static int testHelpStrParsing(const void *data)
|
||||
|
||||
if (virQEMUCapsParseHelpStr("QEMU", help, flags,
|
||||
&version, &is_kvm, &kvm_version, false, NULL) == -1) {
|
||||
if (info->error && virGetLastError()->code == info->error)
|
||||
virErrorPtr err = virGetLastError();
|
||||
|
||||
if (info->error && err && err->code == info->error)
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user