lkml.org 
[lkml]   [2015]   [Jan]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] mm/page_owner: Fix memory leak
From
Date
On Fri, 2015-01-16 at 14:11 +0200, Valentin Ilie wrote:
> Call kfree on list2 after using it.
>
> Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
> ---
> tools/vm/page_owner_sort.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/vm/page_owner_sort.c b/tools/vm/page_owner_sort.c
> index 77147b4..92292d5 100644
> --- a/tools/vm/page_owner_sort.c
> +++ b/tools/vm/page_owner_sort.c
> @@ -139,6 +139,8 @@ int main(int argc, char **argv)
>
> for (i = 0; i < count; i++)
> fprintf(fout, "%d times:\n%s\n", list2[i].num, list2[i].txt);
> +

Checkpatch would have caught the tab you added here.

> + kfree(list2);

You didn't even compile this, did you?

> return 0;
> }

Thanks,


Paul Bolle



\
 
 \ /
  Last update: 2015-01-16 16:21    [W:0.047 / U:0.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site