History | View | Annotate | Download (4.1 kB)
qapi: dealloc visitor, fix premature free and iteration logic
Currently we do 3 things wrong:
1) The list iterator, in practice, is used in a manner where the pointerwe pass in is the same as the pointer we assign the output to fromvisit_next_list(). This causes an infinite loop where we keep freeing...
qapi: dealloc visitor, support freeing of nested lists
Previously our logic for keeping track of when we're visiting the headof a list was done via a global bool. This can be overwritten if dealingwith nested lists, so use stack entries to track this instead....
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: add QAPI dealloc visitor
Type of Visitor class that can be passed into a qapi-generated Ctype's visitor function to free() any heap-allocated data types.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Signed-off-by: Luiz Capitulino <lcapitulino@gmail.com>