Re: [PATCH 2/2] qemu-img: free memory before re-assign

2020-02-26 Thread Pan Nengyuan
On 2/26/2020 6:13 PM, Max Reitz wrote: > On 26.02.20 04:30, Pan Nengyuan wrote: >> 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

Re: [PATCH 2/2] qemu-img: free memory before re-assign

2020-02-26 Thread Max Reitz
On 26.02.20 04:30, Pan Nengyuan wrote: > 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

[PATCH 2/2] qemu-img: free memory before re-assign

2020-02-25 Thread Pan Nengyuan
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 Signed-off-by