From: Alejandro Colomar Date: Tue, 21 Jan 2025 03:13:51 +0000 (+0800) Subject: man/man2/clone.2: Use munmap(2) to free 'stack' X-Git-Tag: man-pages-6.11~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55685aa7d74e1fe25b773886716b386a62717786;p=thirdparty%2Fman-pages.git man/man2/clone.2: Use munmap(2) to free 'stack' Cc: "Eric W. Biederman" Reported-by: Chen Linxuan Message-ID: <647EBDB1A8DE7507+20250121031351.548052-1-chenlinxuan@uniontech.com> Signed-off-by: Alejandro Colomar --- diff --git a/man/man2/clone.2 b/man/man2/clone.2 index 3ffe8e7b8..a8ccc9620 100644 --- a/man/man2/clone.2 +++ b/man/man2/clone.2 @@ -1912,6 +1912,8 @@ main(int argc, char *argv[]) pid = clone(childFunc, stackTop, CLONE_NEWUTS | SIGCHLD, argv[1]); if (pid == \-1) err(EXIT_FAILURE, "clone"); + if (munmap(stack, STACK_SIZE)) + err(EXIT_FAILURE, "munmap"); printf("clone() returned %jd\[rs]n", (intmax_t) pid); \& /* Parent falls through to here */