mbox series

[0/4] Fix memory leak for Manage Assemble Kill mdadm

Message ID 20230424080637.2152893-1-miaoguanqin@huawei.com (mailing list archive)
Headers show
Series Fix memory leak for Manage Assemble Kill mdadm | expand

Message

Guanqin Miao April 24, 2023, 8:06 a.m. UTC
When we test mdadm with asan,i we found some memory leaks.
We fix these memory leaks based on code logic.

Guanqin Miao (4):
  Fix memory leak in file Assemble
  Fix memory leak in file Kill
  Fix memory leak in file Manage
  Fix memory leak in file mdadm

 Assemble.c | 13 +++++++++++--
 Kill.c     |  9 ++++++++-
 Manage.c   | 11 ++++++++++-
 mdadm.c    |  4 ++++
 4 files changed, 33 insertions(+), 4 deletions(-)

Comments

Jes Sorensen Sept. 1, 2023, 4:02 p.m. UTC | #1
On 4/24/23 04:06, Guanqin Miao wrote:
> When we test mdadm with asan,i we found some memory leaks.
> We fix these memory leaks based on code logic.
> 
> Guanqin Miao (4):
>   Fix memory leak in file Assemble
>   Fix memory leak in file Kill
>   Fix memory leak in file Manage
>   Fix memory leak in file mdadm
> 
>  Assemble.c | 13 +++++++++++--
>  Kill.c     |  9 ++++++++-
>  Manage.c   | 11 ++++++++++-
>  mdadm.c    |  4 ++++
>  4 files changed, 33 insertions(+), 4 deletions(-)
> 

I applied this, modulo a fix to the Manage fix, where it would try to
call free(tst) in the abort path, before tst was initialized.

Thanks,
Jes
Jes Sorensen Sept. 1, 2023, 4:07 p.m. UTC | #2
On 9/1/23 12:02, Jes Sorensen wrote:
> On 4/24/23 04:06, Guanqin Miao wrote:
>> When we test mdadm with asan,i we found some memory leaks.
>> We fix these memory leaks based on code logic.
>>
>> Guanqin Miao (4):
>>   Fix memory leak in file Assemble
>>   Fix memory leak in file Kill
>>   Fix memory leak in file Manage
>>   Fix memory leak in file mdadm
>>
>>  Assemble.c | 13 +++++++++++--
>>  Kill.c     |  9 ++++++++-
>>  Manage.c   | 11 ++++++++++-
>>  mdadm.c    |  4 ++++
>>  4 files changed, 33 insertions(+), 4 deletions(-)
>>
> 
> I applied this, modulo a fix to the Manage fix, where it would try to
> call free(tst) in the abort path, before tst was initialized.

Oh and a fix to Assemble where free(st) would goto loop and then
dereference st.

Jes