gdi: fix nullification of instance->context->cache

This commit is contained in:
Norbert Federa 2015-05-14 20:33:21 +02:00
parent f219d341f1
commit 35c11c721e

View File

@ -1355,10 +1355,12 @@ BOOL gdi_init(freerdp* instance, UINT32 flags, BYTE* buffer)
goto fail_image_bitmap;
if (!instance->context->cache)
{
if (!(cache = cache_new(instance->settings)))
goto fail_cache;
instance->context->cache = cache;
instance->context->cache = cache;
}
gdi_register_update_callbacks(instance->update);
@ -1376,7 +1378,11 @@ BOOL gdi_init(freerdp* instance, UINT32 flags, BYTE* buffer)
return TRUE;
fail_register_graphics:
free(cache);
if (cache)
{
instance->context->cache = NULL;
free(cache);
}
fail_cache:
gdi_bitmap_free_ex(gdi->image);
fail_image_bitmap: