Re: potential mem leak when system is low on memory

From: Amit Choudhary
Date: Tue Oct 17 2006 - 14:58:57 EST



> > func()
> > {
> > for (i = 0; i < LENGTH; i++) {
> > var1[i] = kmalloc(size);
> > if (!var1[i])
> > return -ENOMEM;
> >
> > /* mem leak as var1[0] to var1[i - 1] is not freed */
> >
> > }
> > }
> >
> > So, already the system is running low on memory and on top of it there
> > are leaks.
>
> So you've found elementary programming bugs and it would
> be nice to point this places.
>

As of now, when I come across such a leak, I fix it. But if I am unable to do so, I will
definitely send out a mail.

Regards,
Amit Choudhary



__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/