aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@gmail.com>2018-10-14 14:31:32 +0200
committerMichael Kerrisk <mtk.manpages@gmail.com>2018-10-14 14:37:22 +0200
commit49d83458f341c51db45ca30bcd6b35e8189e18d3 (patch)
treeb86b41104f5362b19d3ba36139f0cc7f203cc806
parentc9a35b01a1983ff9277202f0c8e2975b2e57ac02 (diff)
downloadman-pages-49d83458f341c51db45ca30bcd6b35e8189e18d3.tar.gz
alloca.3: Prevent any misunderstanding about when allocated memory is released
Perhaps some people might misunderstand memory allocated by alloca() to be like other memory allocated on the stack: that when the allocation (or the pointer to the allocation) goes out of scope, the memory is freed. Add some text to prevent that misunderstanding. Reported-by: Robin Kuzmin <kuzmin.robin@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
-rw-r--r--man3/alloca.37
1 files changed, 7 insertions, 0 deletions
diff --git a/man3/alloca.3 b/man3/alloca.3
index 4618141ad6..0c06ff6902 100644
--- a/man3/alloca.3
+++ b/man3/alloca.3
@@ -107,6 +107,13 @@ is jumped over by a call to
or
.BR siglongjmp (3).
.PP
+The space allocated by
+.BR alloca ()
+is
+.I not
+automatically deallocated if the pointer that refers to it
+simply goes out of scope.
+.PP
Do not attempt to
.BR free (3)
space allocated by