Is this a kernel memory leak or a process memory leak?

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Sep 22 11:42:34 UTC 2009


On Tue, 22 Sep 2009 04:43:57 -0600, Modulok <modulok at gmail.com> wrote:
> Maybe I'm just not that bright, but I have a question regarding the following:
>
> man 3 getenv
> <snip>
> "Successive calls to setenv() or putenv() assigning a differently sized
> value to the same name will result in a memory leak.  The FreeBSD seman-
> tics for these functions (namely, that the contents of value are copied
> and that old values remain accessible indefinitely) make this bug
> unavoidable.  Future versions may eliminate one or both of these semantic
> guarantees in order to fix the bug."
> </snip>
>
> This is a memory leak within the process which calls sentenv() or
> putenv(), not a memory leak in the kernel, right?

Yes, it's a userland leak.



More information about the freebsd-questions mailing list