qemu-img: initialize MapEntry object
commit2875645b65865ec2832579557c30b2e8b03dcccd
authorJohn Snow <jsnow@redhat.com>
Fri, 5 Feb 2016 18:12:33 +0000 (5 13:12 -0500)
committerKevin Wolf <kwolf@redhat.com>
Mon, 22 Feb 2016 08:49:46 +0000 (22 09:49 +0100)
treef841ee1b0fb33b3c62a63d23b00c4fbfb6752a8f
parentc3bce9d5f986bc22b0692a8fa9d26ce6d304375c
qemu-img: initialize MapEntry object

Commit 16b0d555 introduced an issue where we are not initializing
has_filename for the 'next' MapEntry object, which leads to interesting
errors in both Valgrind and Clang -fsanitize=undefined.

Zero the stack object at allocation AND make sure the utility to
populate the fields properly marks has_filename as false if applicable.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-img.c