Message ID | 1445022763-26469-1-git-send-email-eblake@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/tests/test-qmp-output-visitor.c b/tests/test-qmp-output-visitor.c index 88e01ea..cfb06bb 100644 --- a/tests/test-qmp-output-visitor.c +++ b/tests/test-qmp-output-visitor.c @@ -299,7 +299,8 @@ static void test_visitor_out_struct_errors(TestOutputVisitorData *data, const void *unused) { EnumOne bad_values[] = { ENUM_ONE_MAX, -1 }; - UserDefOne u, *pu = &u; + UserDefOne u = {0}; + UserDefOne *pu = &u; Error *err; int i;
valgrind reports that our testsuite is making a branch based on uninitialized memory; and depending on compile options, the state of the stack could result in the test segfaulting. I missed the fact that we were previously relying on 'u' being fully initialized. Signed-off-by: Eric Blake <eblake@redhat.com> --- Introduced by my patch still under review, so easiest is to squash this in rather than supply it as a separate patch. --- tests/test-qmp-output-visitor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)