]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man2/clone.2: Use munmap(2) to free 'stack'
authorAlejandro Colomar <alx@kernel.org>
Tue, 21 Jan 2025 03:13:51 +0000 (11:13 +0800)
committerAlejandro Colomar <alx@kernel.org>
Mon, 10 Feb 2025 11:42:47 +0000 (12:42 +0100)
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Reported-by: Chen Linxuan <chenlinxuan@uniontech.com>
Message-ID: <647EBDB1A8DE7507+20250121031351.548052-1-chenlinxuan@uniontech.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man2/clone.2

index 3ffe8e7b821545d29575c3e91bdb996de83cbc6a..a8ccc9620ee6410301b6c8f9b2f78abe3fd24993 100644 (file)
@@ -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 */