This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Missing call to iconv_close.
- To: Mo DeJong <mdejong at cygnus dot com>
- Subject: Re: Missing call to iconv_close.
- From: Tom Tromey <tromey at redhat dot com>
- Date: 03 May 2001 17:46:03 -0600
- Cc: java-patches at gcc dot gnu dot org, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Alexandre Petit-Bianco <apbianco at cygnus dot com>
- References: <Pine.SOL.3.91.1010503145013.20899A-100000@cse.cygnus.com>
- Reply-To: tromey at redhat dot com
>>>>> "Mo" == Mo DeJong <mdejong@cygnus.com> writes:
Mo> Here is a quick patch that closes an iconv handle
Mo> that seems to have been left open in gcc/java/lex.c.
Wow, good catch. Did you find this by reading the code, or was there
an actual failure?
Mo> 2001-05-03 Mo DeJong <mdejong@redhat.com>
Mo> * lex.c (java_new_lexer): Call iconv_close
Mo> on temp handle used to check for byte swap.
I CC'd gcc-patches -- front-end patches have to go there as well.
Alex, I definitely think this should go in.
Mo> diff -u -r1.60.2.3 lex.c
Mo> --- lex.c 2001/03/23 05:14:35 1.60.2.3
Mo> +++ lex.c 2001/05/03 21:49:55
Mo> @@ -269,6 +269,7 @@
Mo> outc = 2;
Mo> r = iconv (handle, (const char **) &inp, &inc, &outp, &outc);
Mo> + iconv_close (handle);
Mo> /* Conversion must be complete for us to use the result. */
Mo> if (r != (size_t) -1 && inc == 0 && outc == 0)
Mo> need_byteswap = (result != 0xfeff);
Tom