freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Question about FT_Get_Sfnt_Name


From: ??????
Subject: [ft-devel] Question about FT_Get_Sfnt_Name
Date: Tue, 10 Jan 2017 11:14:22 +0800

Hello, team.

I have a question about FT_Get_Sfnt_Name. The official documentation about this function(https://www.freetype.org/freetype2/docs/reference/ft2-sfnt_names.html#FT_Get_Sfnt_Name) gives the following information:

The ??string?? array returned in the ??aname?? structure is not null-terminated. The application should deallocate it if it is no longer in use.

However, every time I try to free the string, it always causes a double-free error. The error prompts say something like this:
Error in `./testsample': double free or corruption (fasttop): 0x00000000023ff9e0

My code is as simple as the following:
FT_SfntName  name;
FT_Get_Sfnt_Name(face, i, &name);
free(name.string); //This line causes a double-free error.

Although I think the documentation is clear enough about who is responsible for deallocating the 'string' array, or do I misunderstand something in the documentation?

Thank you in advance!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]