diff options
author | Peter Maydell | 2016-07-01 12:18:00 +0200 |
---|---|---|
committer | Peter Maydell | 2016-07-01 12:18:01 +0200 |
commit | 1fb4c13e4f92bda047f30177d5b8c2b4ca42e8b8 (patch) | |
tree | 1a364b8593876135e3490a850d687569b79aa772 /scripts/qapi-visit.py | |
parent | linux-user: Fix compilation when F_SETPIPE_SZ isn't defined (diff) | |
parent | qapi: Fix memleak in string visitors on int lists (diff) | |
download | qemu-1fb4c13e4f92bda047f30177d5b8c2b4ca42e8b8.tar.gz qemu-1fb4c13e4f92bda047f30177d5b8c2b4ca42e8b8.tar.xz qemu-1fb4c13e4f92bda047f30177d5b8c2b4ca42e8b8.zip |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2016-06-30' into staging
QAPI patches 2016-06-30
# gpg: Signature made Thu 30 Jun 2016 14:29:43 BST
# gpg: using RSA key 0x3870B400EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653
* remotes/armbru/tags/pull-qapi-2016-06-30:
qapi: Fix memleak in string visitors on int lists
qapi: Simplify use of range.h
range: Create range.c for code that should not be inline
qapi: Fix crash on missing alternate member of QAPI struct
checkpatch: There is no qemu_strtod()
qobject: Correct JSON lexer grammar comments
json-streamer: Don't leak tokens on incomplete parse
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r-- | scripts/qapi-visit.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index 70ea8caef5..ffb635c508 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -172,6 +172,9 @@ void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error if (err) { goto out; } + if (!*obj) { + goto out_obj; + } switch ((*obj)->type) { ''', c_name=c_name(name), promote_int=promote_int) @@ -206,10 +209,13 @@ void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error ''') ret += mcgen(''' + case QTYPE_NONE: + abort(); default: error_setg(&err, QERR_INVALID_PARAMETER_TYPE, name ? name : "null", "%(name)s"); } +out_obj: visit_end_alternate(v); if (err && visit_is_input(v)) { qapi_free_%(c_name)s(*obj); |