]> git.proxmox.com Git - mirror_qemu.git/commit - qemu-img.c
qemu-img: free memory before re-assign
authorPan Nengyuan <pannengyuan@huawei.com>
Thu, 27 Feb 2020 01:29:50 +0000 (09:29 +0800)
committerMax Reitz <mreitz@redhat.com>
Wed, 11 Mar 2020 11:42:30 +0000 (12:42 +0100)
commitfc124ea1dbfac2a1d5b851596831c9da746b7b66
tree4d4a219616e234bd68fa70722e7ba1d7f54d52e1
parent4aebf0f0da4a57204f568deed14661cb37b4ac30
qemu-img: free memory before re-assign

collect_image_check() is called twice in img_check(), the filename/format will be alloced without free the original memory.
It is not a big deal since the process will exit anyway, but seems like a clean code and it will remove the warning spotted by asan.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Message-Id: <20200227012950.12256-3-pannengyuan@huawei.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
qemu-img.c