Re: [PATCH 2/5 v2] Detail: fix memleak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Guanghao,


> 2022年6月9日 11:06,Wu Guanghao <wuguanghao3@xxxxxxxxxx> 写道:
> 
> char *sysdev = xstrdup() but not free() in for loop, will cause memory
> leak.
> 
> Reported-by: Coverity


The Reported-by tag might be incorrect. Maybe I am wrong but this is the first time I see a non-email reporter here.
Here I copy and past the Reported-by: tag explanation from Linux kernel document, I guess the meaning should be similar,

The Reported-by tag gives credit to people who find bugs and report them and it
hopefully inspires them to help us again in the future.  Please note that if
the bug was reported in private, then ask for permission first before using the
Reported-by tag. The tag is intended for bugs; please do not use it to credit
feature requests.

So you may have an email address for the Reported-by tag, for example the Hulk robot in Linux kernel patches from Huawei,
    Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>

Could you please to update all the Reported-by tags for the series? Then I will start to review the patches.

Thanks.

Coly Li


> Signed-off-by: Wu Guanghao <wuguanghao3@xxxxxxxxxx>
> Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@xxxxxxxxxxxxxxx>
> ---
> Detail.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/Detail.c b/Detail.c
> index ce7a8445..4ef26460 100644
> --- a/Detail.c
> +++ b/Detail.c
> @@ -303,6 +303,7 @@ int Detail(char *dev, struct context *c)
>                                if (path)
>                                        printf("MD_DEVICE_%s_DEV=%s\n",
>                                               sysdev, path);
> +                               free(sysdev);
>                        }
>                }
>                goto out;
> --
> 2.27.0





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux