* [PATCH] Manage.c: fix small memory leak
@ 2013-09-05 9:16 Lukasz Dorau
2013-09-09 23:33 ` NeilBrown
0 siblings, 1 reply; 2+ messages in thread
From: Lukasz Dorau @ 2013-09-05 9:16 UTC (permalink / raw)
To: neilb; +Cc: linux-raid, pawel.baldysiak
'avail' is dynamically allocated, so it should be freed.
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
---
Manage.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/Manage.c b/Manage.c
index afa9b42..910caa6 100644
--- a/Manage.c
+++ b/Manage.c
@@ -853,6 +853,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
}
array_failed = !enough(array->level, array->raid_disks,
array->layout, 1, avail);
+ free(avail);
} else
array_failed = 0;
if (array_failed) {
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Manage.c: fix small memory leak
2013-09-05 9:16 [PATCH] Manage.c: fix small memory leak Lukasz Dorau
@ 2013-09-09 23:33 ` NeilBrown
0 siblings, 0 replies; 2+ messages in thread
From: NeilBrown @ 2013-09-09 23:33 UTC (permalink / raw)
To: Lukasz Dorau; +Cc: linux-raid, pawel.baldysiak
[-- Attachment #1: Type: text/plain, Size: 685 bytes --]
On Thu, 05 Sep 2013 11:16:34 +0200 Lukasz Dorau <lukasz.dorau@intel.com>
wrote:
> 'avail' is dynamically allocated, so it should be freed.
>
> Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
> ---
> Manage.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Manage.c b/Manage.c
> index afa9b42..910caa6 100644
> --- a/Manage.c
> +++ b/Manage.c
> @@ -853,6 +853,7 @@ int Manage_add(int fd, int tfd, struct mddev_dev *dv,
> }
> array_failed = !enough(array->level, array->raid_disks,
> array->layout, 1, avail);
> + free(avail);
> } else
> array_failed = 0;
> if (array_failed) {
Applied. Thanks.
NeilBrown
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-09 23:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-05 9:16 [PATCH] Manage.c: fix small memory leak Lukasz Dorau
2013-09-09 23:33 ` NeilBrown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).