libfreerdp-cache/bitmap: add a pointer check to fix a segfault.

This commit is contained in:
Vic Lee 2011-11-17 10:15:28 +08:00
parent 53f85ca00f
commit 177600eb90
1 changed files with 2 additions and 1 deletions

View File

@ -246,7 +246,8 @@ void bitmap_cache_free(rdpBitmapCache* bitmap_cache)
xfree(bitmap_cache->cells[i].entries);
}
bitmap_cache->bitmap->Free(bitmap_cache->context, bitmap_cache->bitmap);
if (bitmap_cache->bitmap != NULL)
bitmap_cache->bitmap->Free(bitmap_cache->context, bitmap_cache->bitmap);
xfree(bitmap_cache->cells);
xfree(bitmap_cache);