Qian Hong fracting@gmail.com wrote:
- GetEnumStructs( face, &elf, &ntm, &type );
- if (!get_enum_structs( face, &elf, &ntm, &type )) return FALSE; free_family( family );
'face' and 'family' are leaked here. Also returning FALSE at this point is too late since both 'face' and 'family' are already in the linked lists.
Hello,
On Thu, Dec 6, 2012 at 3:42 PM, Dmitry Timoshkov dmitry@baikal.ru wrote:
'face' and 'family' are leaked here. Also returning FALSE at this point is too late since both 'face' and 'family' are already in the linked lists.
Thanks for point out this! I'll investigate more.
-- Regards, Qian Hong
- Sent from Ubuntu http://www.ubuntu.com/
Hello,
On Thu, Dec 6, 2012 at 3:19 PM, Qian Hong fracting@gmail.com wrote:
Hello,
On Thu, Dec 6, 2012 at 3:42 PM, Dmitry Timoshkov dmitry@baikal.ru wrote:
'face' and 'family' are leaked here. Also returning FALSE at this point is too late since both 'face' and 'family' are already in the linked lists.
Thanks for point out this! I'll investigate more.
The 'family' is not inserted to the font list here, get_enum_structs() is called by get_fontdir(), which is called by WineEngCreateScalableFontResource(). When we create a scalable font resource, we don't add the font to the font list, we add the font to the font list in WineEngAddFontResourceEx() instead, so there is no need to worry about returning FALSE at this point. The only reason to create a family and insert the face to the family here is because get_enum_structs() need to copy string from face->family->FamilyName.
I've send an improved patch which fixed the memory leak issue, thanks for your good eyes :) Please let me know if I'm wrong with the above thinking, thanks!
-- Regards, Qian Hong
- Sent from Ubuntu http://www.ubuntu.com/