提交 5ddaa7ef 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
上级 dfb18b0a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册