Currently we do 3 things wrong: 1) The list iterator, in practice, is used in a manner where the pointer we pass in is the same as the pointer we assign the output to from visit_next_list(). This causes an infinite loop where we keep freeing the same structures. 2) We attempt to free list->value rather than list. visit_type_<type> handles this. We should only be concerned with the containing list. 3) We free prematurely: iterator function will continue accessing values we've already freed. This patch should fix all of these issues. QmpOutputVisitor also suffers from 1). Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> |
||
|---|---|---|
| .. | ||
| qapi-dealloc-visitor.c | ||
| qapi-dealloc-visitor.h | ||
| qapi-types-core.h | ||
| qapi-visit-core.c | ||
| qapi-visit-core.h | ||
| qmp-core.h | ||
| qmp-dispatch.c | ||
| qmp-input-visitor.c | ||
| qmp-input-visitor.h | ||
| qmp-output-visitor.c | ||
| qmp-output-visitor.h | ||
| qmp-registry.c | ||