summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authorLuiz Capitulino2011-10-19 18:51:14 +0200
committerLuiz Capitulino2011-10-27 15:48:46 +0200
commit694a099a542563f40116743c963066ce142a7755 (patch)
treedbfa59092dd4abe25963c7b70a038ad67dd811e2 /input.c
parentMerge branch 'target-arm.for-upstream' of git://git.linaro.org/people/pmaydel... (diff)
downloadqemu-694a099a542563f40116743c963066ce142a7755.tar.gz
qemu-694a099a542563f40116743c963066ce142a7755.tar.xz
qemu-694a099a542563f40116743c963066ce142a7755.zip
qapi-commands.py: Don't call the output marshal on error
Today we generate something like this: int qmp_marshal_input_query_foo(...) ... retval = qmp_query_foo(errp); qmp_marshal_output_query_foo(retval, ret, errp); ... However, if qmp_query_foo() fails 'retval' will probably be NULL, which can cause a segfault as not all visitors check if 'retval' is valid. This commit fixes that by changing the code generator to only call the output marshal if qmp_query_foo() succeeds, like this: retval = qmp_query_foo(errp); if (!error_is_set(errp)) { qmp_marshal_output_query_foo(retval, ret, errp); } Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'input.c')
0 files changed, 0 insertions, 0 deletions