mirror of https://gitee.com/openkylin/qemu.git
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: Eric 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: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
c49d3411fa
commit
d08ac81a45
|
@ -301,7 +301,9 @@ def gen_visit_union(name, base, variants):
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue