2003-07-01 Michael Koch <konqueror@gmx.de>
authorMichael Koch <konqueror@gmx.de>
Tue, 1 Jul 2003 14:42:38 +0000 (14:42 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Tue, 1 Jul 2003 14:42:38 +0000 (14:42 +0000)
* gnu/gcj/convert/natIconv.cc
(iconv_init): Fixed possible memory leak by releasing allocated iconv
handle.

From-SVN: r68774

libjava/ChangeLog
libjava/gnu/gcj/convert/natIconv.cc

index 32af9058169523cc53cf345839ac19eab4e1418d..0377102851a841bb895e06803e5b50b9e14b989c 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-01  Michael Koch  <konqueror@gmx.de>
+
+       * gnu/gcj/convert/natIconv.cc
+       (iconv_init): Fixed possible memory leak by releasing allocated iconv
+       handle.
+
 2003-06-30  Thomas Fitzsimmons  <fitzsim@redhat.com>
 
        * glib-2.0.m4: New file.
index 0ed8606f94b282e652a0f70cfc53cd2db0a107f1..7b7ec64488eceda3eb744c333bec323826baedf1 100644 (file)
@@ -268,6 +268,9 @@ gnu::gcj::convert::IOConverter::iconv_init (void)
       // Conversion must be complete for us to use the result.
       if (r != (size_t) -1 && inc == 0 && outc == 0)
        result = (c != 0xfeff);
+
+      // Release iconv handle.
+      iconv_close (handle);
     }
 #endif /* HAVE_ICONV */
   return result;