From: Tobias Stoeckmann Date: Sat, 11 Apr 2026 18:52:28 +0000 (+0200) Subject: chmem: Skip optarg duplication X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ea506194ebad0b1b1f147d4782fc7689c44568f0;p=thirdparty%2Futil-linux.git chmem: Skip optarg duplication The -z argument is only used for parsing without any modification of the input string. Skip the duplication to fix memory leaks if -z is supplied multiple times. Signed-off-by: Tobias Stoeckmann --- diff --git a/sys-utils/chmem.c b/sys-utils/chmem.c index 5380e9704..b7f3cb568 100644 --- a/sys-utils/chmem.c +++ b/sys-utils/chmem.c @@ -721,7 +721,7 @@ int main(int argc, char **argv) desc->verbose = 1; break; case 'z': - zone = xstrdup(optarg); + zone = optarg; break; case 'c': cmd = CMD_MEMORY_CONFIGURE;