GNOME Bugzilla – Bug 95730
hangul-x leaks if Jamo length >= 6.
Last modified: 2004-12-22 21:47:04 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.
Created attachment 11529 [details] [review] FIxes leaks
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?
Yes, it need to be copied. A patch in bug 95569 has the fix.
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).