umanwizard / libeot

Library for parsing Embedded OpenType files (Microsoft embedded font "standard"), and converting them to other formats
Other
14 stars 6 forks source link

Fix leak when fail convert #12

Open anhngduc opened 3 weeks ago

anhngduc commented 3 weeks ago

If EOTfillMetadata() success but convert is failed => need to free "metadataOut" too.

==939885== 58 bytes in 1 blocks are definitely lost in loss record 4 of 5 ==939885== at 0x483C815: malloc (vg_replace_malloc.c:446) ==939885== by 0x485621E: EOTgetString (EOT.c:51) ==939885== by 0x4856AA9: EOTfillMetadataSpecifyingVersion (EOT.c:188) ==939885== by 0x4857163: EOTfillMetadata (EOT.c:272) ==939885== by 0x4855EBA: EOT2ttf_file (libeot.c:50) ==939885== by 0x109496: main (eot2ttf.c:55)