[PATCH] bzip2recover: bsClose bsIn before exit
Mark Wielaard
mark@klomp.org
Thu Jun 11 21:17:18 GMT 2026
On Thu, May 28, 2026 at 07:22:16PM +0200, Mark Wielaard wrote:
> This makes sure to cleanup all the memory used and opened file
> descriptors.
>
> With this fix valgrind shows no more "leaked" file descriptors or
> memory when run with --leak-check=full --show-leak-kinds=all
> --track-fds=yes on a valid bzip2 file.
Pushed.
> ---
> bzip2recover.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/bzip2recover.c b/bzip2recover.c
> index c62210373fe5..6144284e6c04 100644
> --- a/bzip2recover.c
> +++ b/bzip2recover.c
> @@ -508,6 +508,8 @@ Int32 main ( Int32 argc, Char** argv )
> }
> }
>
> + bsClose ( bsIn );
> +
> fprintf ( stderr, "%s: finished\n", progName );
> return 0;
> }
> --
> 2.54.0
>
More information about the Bzip2-devel
mailing list