This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libio: Fix gconv-related memory leak [BZ #24583]


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]