Fixed missing NULL pointer checks.

This commit is contained in:
Armin Novak 2016-10-04 09:57:52 +02:00
parent 0c81f4a28b
commit 2cf5f1b0ba

View File

@ -688,12 +688,13 @@ void glyph_cache_register_callbacks(rdpUpdate* update)
rdpGlyphCache* glyph_cache_new(rdpSettings* settings)
{
int i;
rdpGlyphCache* glyphCache;
glyphCache = (rdpGlyphCache*) calloc(1, sizeof(rdpGlyphCache));
if (glyphCache)
{
int i;
if (!glyphCache)
return NULL;
WLog_Init();
glyphCache->log = WLog_Get("com.freerdp.cache.glyph");
glyphCache->settings = settings;
@ -706,12 +707,20 @@ rdpGlyphCache* glyph_cache_new(rdpSettings* settings)
settings->GlyphCache[i].cacheMaximumCellSize;
glyphCache->glyphCache[i].entries = (rdpGlyph**) calloc(
glyphCache->glyphCache[i].number, sizeof(rdpGlyph*));
if (!glyphCache->glyphCache[i].entries)
goto fail;
}
glyphCache->fragCache.entries = calloc(256, sizeof(FRAGMENT_CACHE_ENTRY));
}
if (!glyphCache->fragCache.entries)
goto fail;
return glyphCache;
fail:
glyph_cache_free(glyphCache);
return NULL;
}
void glyph_cache_free(rdpGlyphCache* glyphCache)