summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-01-26 22:10:56 +0000
committerarchie <archie@FreeBSD.org>2000-01-26 22:10:56 +0000
commitaf563a21f8a15eb3b2c36a726ec48aac4ec87496 (patch)
treef3ab65df67dcbdb92b08a01af6c24b3c0ea01770
parent860c8411e16b55730d5f2a310ff816581da1ce7e (diff)
downloadFreeBSD-src-af563a21f8a15eb3b2c36a726ec48aac4ec87496.zip
FreeBSD-src-af563a21f8a15eb3b2c36a726ec48aac4ec87496.tar.gz
Document the memory leak that is inherent in FreeBSD's semantics
for getenv()/putenv(). PR: 10341 5604
-rw-r--r--lib/libc/stdlib/getenv.315
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libc/stdlib/getenv.3 b/lib/libc/stdlib/getenv.3
index 3347bda..aff0d7d 100644
--- a/lib/libc/stdlib/getenv.3
+++ b/lib/libc/stdlib/getenv.3
@@ -139,6 +139,21 @@ The
.Fn getenv
function conforms to
.St -ansiC .
+.Sh BUGS
+Successive calls to
+.Fn setenv
+or
+.Fn putenv
+assigning a differently sized
+.Ar value
+to the same
+.Ar name
+will result in a memory leak. The FreeBSD semantics for these functions
+(namely, that the contents of
+.Ar 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.
.Sh HISTORY
The functions
.Fn setenv
OpenPOWER on IntegriCloud