提交 415168e0 编写于 作者: M Markus Armbruster 提交者: Luiz Capitulino

hmp: Guard against misuse of hmp_handle_error()

Null errp argument makes no sense.  Assert it's not null, to make this
explicit, and guard against misuse.  All current callers pass non-null
errp.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 a903f40c
......@@ -28,7 +28,8 @@
static void hmp_handle_error(Monitor *mon, Error **errp)
{
if (error_is_set(errp)) {
assert(errp);
if (*errp) {
monitor_printf(mon, "%s\n", error_get_pretty(*errp));
error_free(*errp);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册