This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


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

Re: Missing call to iconv_close.


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


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