After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 69153 - PATCH: g_convert_with_fallback converter leak
PATCH: g_convert_with_fallback converter leak
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
1.3.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2002-01-20 01:23 UTC by Jeffrey Stedfast
Modified: 2011-02-18 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
descriptor-leak.patch (1.13 KB, patch)
2002-01-20 01:23 UTC, Jeffrey Stedfast
none Details | Review

Description Jeffrey Stedfast 2002-01-20 01:23:02 UTC
when in the fallback case, after opening a converter for UTF-8 ->
to_codeset, if the next g_convert() call fails (thus setting utf8 to NULL),
the converter is never closed before aborting and returning NULL to the
caller.

Attached is a patch
Comment 1 Jeffrey Stedfast 2002-01-20 01:23:32 UTC
Created attachment 6450 [details] [review]
descriptor-leak.patch
Comment 2 Owen Taylor 2002-01-21 19:30:35 UTC
Looks good to commit , but in reviewing the patch, I noticed 
two other bugs:

 - bytes_written is not set to zero if it exits in the
   place where you added the iconv_cloes()

 - bytes_written is given an invalid value in the normal
   return case; should be 'outp - dest', not 'outp - str'

If you could fix those while you are at it, it would
be great :-)
Comment 3 Jeffrey Stedfast 2002-01-21 21:00:14 UTC
no prob. committed to cvs with your fixes as well.