Fixed unchecked free in glyph.c (related to #1428)

This commit is contained in:
Armin Novak 2013-09-06 11:35:54 +02:00
parent 3b931a9d69
commit 1f4205a04e

View File

@ -403,7 +403,8 @@ void glyph_cache_put(rdpGlyphCache* glyph_cache, UINT32 id, UINT32 index, rdpGly
if (prevGlyph != NULL)
{
Glyph_Free(glyph_cache->context, prevGlyph);
free(prevGlyph->aj);
if (NULL != prevGlyph->aj)
free(prevGlyph->aj);
free(prevGlyph);
}
@ -498,12 +499,14 @@ void glyph_cache_free(rdpGlyphCache* glyph_cache)
if (glyph != NULL)
{
Glyph_Free(glyph_cache->context, glyph);
free(glyph->aj);
if (glyph->aj)
free(glyph->aj);
free(glyph);
glyph_cache->glyphCache[i].entries[j] = NULL;
}
}
free(glyph_cache->glyphCache[i].entries);
glyph_cache->glyphCache[i].entries = NULL;
}
for (i = 0; i < 255; i++)