memory not freed
Reported directly by feedback form. Changes from a recent pull request resulted in more array entries than MAX_GLYPH, so the for loop in free_glyphid_cache() wasn't going far enough, leaving some dupstr() strings unfreed.
This commit is contained in:
+5
-5
@@ -371,14 +371,14 @@ init_glyph_cache(void)
|
|||||||
|
|
||||||
void free_glyphid_cache(void)
|
void free_glyphid_cache(void)
|
||||||
{
|
{
|
||||||
int glyph;
|
size_t idx;
|
||||||
|
|
||||||
if (!glyphid_cache)
|
if (!glyphid_cache)
|
||||||
return;
|
return;
|
||||||
for (glyph = 0; glyph < MAX_GLYPH; ++glyph) {
|
for (idx = 0; idx < glyphid_cache_size; ++idx) {
|
||||||
if (glyphid_cache[glyph].id) {
|
if (glyphid_cache[idx].id) {
|
||||||
free(glyphid_cache[glyph].id);
|
free(glyphid_cache[idx].id);
|
||||||
glyphid_cache[glyph].id = (char *) 0;
|
glyphid_cache[idx].id = (char *) 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(glyphid_cache);
|
free(glyphid_cache);
|
||||||
|
|||||||
Reference in New Issue
Block a user