From 4b9b827117cecd7571c0952b501fa84c4bd7e5fb Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Tue, 21 Jul 2026 13:50:13 +0300 Subject: [PATCH] xz: Free the filename read from the file specified with --files/--files0 Like the previous commit, this cleans up leak detection slightly. Otherwise it doesn't matter because xz is going to exit soon anyway. --- src/xz/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/xz/main.c b/src/xz/main.c index 5dabc5ae..fe5ff4ad 100644 --- a/src/xz/main.c +++ b/src/xz/main.c @@ -89,7 +89,7 @@ read_name(const args_info *args) message_error(_("%s: Error reading filenames: %s"), tuklib_mask_nonprint(args->files_name), strerror(errno)); - return NULL; + break; } if (feof(args->files_file)) { @@ -99,7 +99,7 @@ read_name(const args_info *args) tuklib_mask_nonprint( args->files_name)); - return NULL; + break; } if (c == args->files_delim) { @@ -125,7 +125,7 @@ read_name(const args_info *args) "of '--files'?"), tuklib_mask_nonprint( args->files_name)); - return NULL; + break; } name[pos++] = c; @@ -149,6 +149,8 @@ read_name(const args_info *args) } } + free(name); + name = NULL; return NULL; }