lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 16 Jan 2015 16:30:53 +0100
From:	Paul Bolle <pebolle@...cali.nl>
To:	Valentin Ilie <valentin.ilie@...il.com>
Cc:	iamjoonsoo.kim@....com, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/page_owner: Fix memory leak

(I dislike it when people set a trap for me, so on second thought I tell
you what I should have added right away.) 

On Fri, 2015-01-16 at 16:03 +0100, Paul Bolle wrote:
> 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@...il.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;
> >  }

Before you resend: what happens to the resources of a userspace program
when its main() returns?


Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ