qemu/scripts/qapi
Markus Armbruster c978bd5226 qapi: Clean up visitor's recovery from input with invalid type
An alternate type's visit_type_FOO() fails when it runs into an
invalid ->type.  If it's an input visit, we then need to free the the
object we got from visit_start_alternate().  We do that with
qapi_free_FOO(), which uses the dealloc visitor.

Trouble is that object is in a bad state: its ->type is invalid.  So
the dealloc visitor will run into the same error again, and the error
recovery skips deallocating the alternate's (invalid) alternative.
Works, because qapi_free_FOO() ignores the error.

Avoid it instead: free the messed up object with by g_free().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200424084338.26803-11-armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2020-04-30 07:26:40 +02:00
..
__init__.py qapi-gen: New common driver for code and doc generators 2018-03-02 13:14:09 -06:00
commands.py qapi: Consistently put @features parameter right after @ifcond 2020-03-17 19:58:34 +01:00
common.py qapi: Drop conditionals for Python 2 2020-03-05 09:24:11 +01:00
doc.py qapi: Consistently put @features parameter right after @ifcond 2020-03-17 19:58:34 +01:00
error.py qapi: Use super() now we have Python 3 2020-03-05 09:24:11 +01:00
events.py qapi: Add feature flags to remaining definitions 2020-03-17 19:58:34 +01:00
expr.py qapi: Add feature flags to struct members 2020-03-17 21:25:47 +01:00
gen.py qemu-storage-daemon: Add --monitor option 2020-03-06 17:21:28 +01:00
introspect.py qapi: Add feature flags to struct members 2020-03-17 21:25:47 +01:00
parser.py qapi: Brush off some (py)lint 2020-03-05 09:24:11 +01:00
schema.py qapi: New special feature flag "deprecated" 2020-03-17 21:42:47 +01:00
source.py qapi: Inheriting from object is pointless with Python 3, drop 2020-03-05 09:24:11 +01:00
types.py qapi: Consistently put @features parameter right after @ifcond 2020-03-17 19:58:34 +01:00
visit.py qapi: Clean up visitor's recovery from input with invalid type 2020-04-30 07:26:40 +02:00