From 49d83458f341c51db45ca30bcd6b35e8189e18d3 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 14 Oct 2018 14:31:32 +0200 Subject: [PATCH] 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 Signed-off-by: Michael Kerrisk --- man3/alloca.3 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/man3/alloca.3 b/man3/alloca.3 index 4618141ad..0c06ff690 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 -- 2.11.4.GIT