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 95730 - hangul-x leaks if Jamo length >= 6.
hangul-x leaks if Jamo length >= 6.
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.0.x
Other other
: Normal major
: 1.0.6
Assigned To: Owen Taylor
Owen Taylor
Depends on:
Blocks:
 
 
Reported: 2002-10-14 15:46 UTC by Changwoo Ryu
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
FIxes leaks (816 bytes, patch)
2002-10-14 15:48 UTC, Changwoo Ryu
none Details | Review

Description Changwoo Ryu 2002-10-14 15:46:59 UTC
In hangul_engine_shape(), the code allocates new array from the heap when
jamos_static[4] or newly allocated array is not enough.  But if the lengh
>=6, it doesn't free the old array.  For example:

1. it uses jamos_static[4]
2. when 5th jamo is input, it allocates new array.
3. when 6th jamo is input, it allocates another new array.  (leaks!)
4. free the array which was allocated at 3.
Comment 1 Changwoo Ryu 2002-10-14 15:48:43 UTC
Created attachment 11529 [details] [review]
FIxes leaks
Comment 2 Owen Taylor 2002-10-14 16:05:33 UTC
Looks fine to commit. HEAD has:

                  if (jamos == jamos_static)
                    jamos = g_new (gunichar2, max_jamos);
                  else
                    jamos = g_renew (gunichar2, jamos, max_jamos);

Does it need to copy the data from james_static to the 
new array?
Comment 3 Changwoo Ryu 2002-10-15 02:59:05 UTC
Yes, it need to be copied.  A patch in bug 95569 has the fix.
Comment 4 Changwoo Ryu 2002-10-15 03:03:26 UTC
Applied to the pango-1-0 branch.


2002-10-15  Changwoo Ryu  <cwryu@debian.org>

	* modules/hangul/hangul-x.c (hangul_engine_shape): Fixed leaks
	when the Hangul jamos length >= 6 (#95730).