summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2015-11-05 23:35:29 -0700
committerMarkus Armbruster <armbru@redhat.com>2015-11-09 16:45:05 +0100
commitb18f1141d0afa00de11a8e079f4f5305c9e36893 (patch)
tree71b1c9909479a257f9048dc0b42a549cda822a17 /util
parent0920a17199d23b3def3a60fa1fbbdeadcdda452d (diff)
downloadhqemu-b18f1141d0afa00de11a8e079f4f5305c9e36893.zip
hqemu-b18f1141d0afa00de11a8e079f4f5305c9e36893.tar.gz
qapi: Plug leaks in test-qmp-*
Make valgrind happy with the current state of the tests, so that it is easier to see if future patches introduce new memory problems without being drowned in noise. Many of the leaks were due to calling a second init without tearing down the data from an earlier visit. But since teardown is already idempotent, and we already register teardown as part of input_visitor_test_add(), it is nicer to just make init() safe to call multiple times than it is to have to make all tests call teardown. Another common leak was forgetting to clean up an error object, after testing that an error was raised. Another leak was in test_visitor_in_struct_nested(), failing to clean the base member of UserDefTwo. Cleaning that up left check_and_free_str() as dead code (since using the qapi_free_* takes care of recursion, and we don't want double frees). A final leak was in test_visitor_out_any(), which was reassigning the qobj local variable to a subset of the overall structure needing freeing; it did not result in a use-after-free, but was not cleaning up all the qdict. test-qmp-event and test-qmp-commands were already clean. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1446791754-23823-6-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'util')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud