[PATCH v2 0/2] fix two small memleaks

Pan Nengyuan posted 2 patches 5 years, 8 months ago
Test docker-quick@centos7 failed
Test FreeBSD failed
Test docker-mingw@fedora failed
Test checkpatch failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200227012950.12256-1-pannengyuan@huawei.com
Maintainers: Max Reitz <mreitz@redhat.com>, Kevin Wolf <kwolf@redhat.com>
block/qcow2.c | 1 +
qemu-img.c    | 2 ++
2 files changed, 3 insertions(+)
[PATCH v2 0/2] fix two small memleaks
Posted by Pan Nengyuan 5 years, 8 months ago
This series fix two small memleaks.
1. 'crypto_opts' forgot to free in qcow2_close(), do this cleanup in qcow2_close();
2. Do free filename/format in collect_image_check() when we re-allocate it.  

v2->v1:
- Instead of freeing part of fields in collect_image_check(), do discard the old check object and allocate a new one in the caller to make more sense.(suggested by Max Reitz)

Pan Nengyuan (2):
  block/qcow2: do free crypto_opts in qcow2_close()
  qemu-img: free memory before re-assign

 block/qcow2.c | 1 +
 qemu-img.c    | 2 ++
 2 files changed, 3 insertions(+)

-- 
2.18.2


Re: [PATCH v2 0/2] fix two small memleaks
Posted by Max Reitz 5 years, 8 months ago
On 27.02.20 02:29, Pan Nengyuan wrote:
> This series fix two small memleaks.
> 1. 'crypto_opts' forgot to free in qcow2_close(), do this cleanup in qcow2_close();
> 2. Do free filename/format in collect_image_check() when we re-allocate it.  
> 
> v2->v1:
> - Instead of freeing part of fields in collect_image_check(), do discard the old check object and allocate a new one in the caller to make more sense.(suggested by Max Reitz)
> 
> Pan Nengyuan (2):
>   block/qcow2: do free crypto_opts in qcow2_close()
>   qemu-img: free memory before re-assign
> 
>  block/qcow2.c | 1 +
>  qemu-img.c    | 2 ++
>  2 files changed, 3 insertions(+)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block

Max