block/qapi: Fix memory leak in qmp_query_blockstats()
commitf62492bb8d1ea7f7e156ffbdf411de46107072c5
authorKevin Wolf <kwolf@redhat.com>
Mon, 13 Aug 2018 13:23:49 +0000 (13 15:23 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 15 Aug 2018 10:50:39 +0000 (15 12:50 +0200)
tree7d839f1f9ea41aa5fa7e661339057da0064d9d82
parent38441756b70eec5807b5f60dad11a93a91199866
block/qapi: Fix memory leak in qmp_query_blockstats()

For BlockBackends that are skipped in query-blockstats, we would leak
info since commit 567dcb31. Allocate info only later to avoid the memory
leak.

Fixes: CID 1394727
Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
block/qapi.c