This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] libio: Fix gconv-related memory leak [BZ #24583]
- From: Andreas Schwab <schwab at suse dot de>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 20 May 2019 16:05:28 +0200
- Subject: Re: [PATCH] libio: Fix gconv-related memory leak [BZ #24583]
- References: <87sgt9jp5x.fsf@oldenburg2.str.redhat.com>
On Mai 20 2019, Florian Weimer <fweimer@redhat.com> wrote:
> diff --git a/libio/iofclose.c b/libio/iofclose.c
> index 8a80dd0b78..f4c7299db3 100644
> --- a/libio/iofclose.c
> +++ b/libio/iofclose.c
> @@ -61,10 +61,10 @@ _IO_new_fclose (FILE *fp)
> the conversion functions. */
> struct _IO_codecvt *cc = fp->_codecvt;
>
> - __libc_lock_lock (__gconv_lock);
> - __gconv_release_step (cc->__cd_in.__cd.__steps);
> - __gconv_release_step (cc->__cd_out.__cd.__steps);
> - __libc_lock_unlock (__gconv_lock);
> + __gconv_close_transform (cc->__cd_in.__cd.__steps,
> + cc->__cd_in.__cd.__nsteps);
> + __gconv_close_transform (cc->__cd_out.__cd.__steps,
> + cc->__cd_out.__cd.__nsteps);
Are the __steps always allocated? In get_gconv_fcts I see them being
set to static data.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."