summary refs log tree commit diff stats
path: root/hw/core/machine-qmp-cmds.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2021-01-13 16:10:09 -0600
committerMarkus Armbruster <armbru@redhat.com>2021-01-28 08:08:45 +0100
commite9d635ea1809a6e114c33413c359abbb88a35737 (patch)
tree2747e2df9f82e8e4250a5f8806530d5446d56658 /hw/core/machine-qmp-cmds.c
parentbf159f0bdc7b8e7aa8342dedb3829ca744c1b612 (diff)
downloadfocaccia-qemu-e9d635ea1809a6e114c33413c359abbb88a35737.tar.gz
focaccia-qemu-e9d635ea1809a6e114c33413c359abbb88a35737.zip
net: Clarify early exit condition
On first glance, the loop in qmp_query_rx_filter() has early return
paths that could leak any allocation of filter_list from a previous
iteration.  But on closer inspection, it is obvious that all of the
early exits are guarded by has_name, and that the bulk of the loop
body can be executed at most once if the user is filtering by name,
thus, any early exit coincides with an empty list.  Add asserts to
make this obvious.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210113221013.390592-2-eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/core/machine-qmp-cmds.c')
0 files changed, 0 insertions, 0 deletions