提交 f7212f6b 编写于 作者: J John Ferlan

virhook: Resolve Coverity NULL_RETURNS

Coverity complains that many other callers to return err from
virGetLastError() will check if err is not NULL before dereferencing
it.  Just do the same here for safety.
上级 59802f23
......@@ -300,7 +300,8 @@ virHookCall(int driver,
if (ret < 0) {
/* Convert INTERNAL_ERROR into known error. */
virErrorPtr err = virGetLastError();
virReportError(VIR_ERR_HOOK_SCRIPT_FAILED, "%s", err->message);
virReportError(VIR_ERR_HOOK_SCRIPT_FAILED, "%s",
err ? err->message : _("unknown error"));
}
virCommandFree(cmd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册