提交 d08ac81a 编写于 作者: E Eric Blake 提交者: Markus Armbruster

qapi: Fix regression with '-netdev help'

Commit e36c714e causes 'qemu -netdev help' to dump core, because the
call to visit_end_union() is no longer conditional on whether *obj was
allocated.

Reported by Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: NEric Blake <eblake@redhat.com>
Message-Id: <1444861825-19256-1-git-send-email-eblake@redhat.com>
[Commit message tweaked to say 'help' instead of '?']
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
上级 c49d3411
......@@ -301,7 +301,9 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
out_obj:
error_propagate(errp, err);
err = NULL;
visit_end_union(v, !!(*obj)->data, &err);
if (*obj) {
visit_end_union(v, !!(*obj)->data, &err);
}
error_propagate(errp, err);
err = NULL;
visit_end_struct(v, &err);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册