Message ID | 35fd23fc-4f3d-a6fe-c4b1-79a7b09acead@huawei.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Coly Li |
Headers | show |
Series | mdadm: fix memory leak and double free | expand |
Hi Guanghao, > 2022年6月9日 11:06,Wu Guanghao <wuguanghao3@huawei.com> 写道: > > 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@huawei.com> 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@huawei.com> > Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> > --- > 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
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;