Skip to content

Commit

Permalink
Fix memory error + leak in fontface cache (#4794)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Jun 16, 2015
1 parent 61592a7 commit 6b982bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fontcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void msFreeFontCache(ft_cache *c) {
}
#endif
FT_Done_Face(cur_face->face);
free(cur_face->font);
UT_HASH_DEL(c->face_cache,cur_face);
free(cur_face);
}
Expand Down Expand Up @@ -227,9 +228,10 @@ face_element* msGetFontFace(char *key, fontSetObj *fontset) {
FT_Select_Charmap(fc->face, FT_ENCODING_APPLE_ROMAN);
/* the previous calls may have failed, we ignore as there's nothing much left to do */
}
fc->font = key;
fc->font = msStrdup(key);
UT_HASH_ADD_KEYPTR(hh,cache->face_cache,fc->font, strlen(key), fc);
}

return fc;
}

Expand Down

0 comments on commit 6b982bb

Please sign in to comment.