Merge pull request #4423 from akallabeth/double_free
bitmap free now always deallocating all resources.
This commit is contained in:
commit
c44605299f
@ -178,11 +178,14 @@ static void xf_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap)
|
||||
|
||||
if (xbitmap->image)
|
||||
{
|
||||
xbitmap->image->data = NULL;
|
||||
XDestroyImage(xbitmap->image);
|
||||
xbitmap->image = NULL;
|
||||
}
|
||||
|
||||
xf_unlock_x11(xfc, FALSE);
|
||||
_aligned_free(bitmap->data);
|
||||
free(xbitmap);
|
||||
}
|
||||
|
||||
static BOOL xf_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap)
|
||||
|
@ -57,14 +57,7 @@ static BOOL Bitmap_New(rdpContext* context, rdpBitmap* bitmap)
|
||||
void Bitmap_Free(rdpContext* context, rdpBitmap* bitmap)
|
||||
{
|
||||
if (bitmap)
|
||||
{
|
||||
bitmap->Free(context, bitmap);
|
||||
|
||||
if (bitmap->data)
|
||||
_aligned_free(bitmap->data);
|
||||
|
||||
free(bitmap);
|
||||
}
|
||||
}
|
||||
|
||||
BOOL Bitmap_SetRectangle(rdpBitmap* bitmap,
|
||||
|
@ -115,7 +115,11 @@ static void gdi_Bitmap_Free(rdpContext* context, rdpBitmap* bitmap)
|
||||
gdi_SelectObject(gdi_bitmap->hdc, (HGDIOBJECT) gdi_bitmap->org_bitmap);
|
||||
gdi_DeleteObject((HGDIOBJECT) gdi_bitmap->bitmap);
|
||||
gdi_DeleteDC(gdi_bitmap->hdc);
|
||||
|
||||
_aligned_free(bitmap->data);
|
||||
}
|
||||
|
||||
free(bitmap);
|
||||
}
|
||||
|
||||
static BOOL gdi_Bitmap_Paint(rdpContext* context, rdpBitmap* bitmap)
|
||||
|
Loading…
Reference in New Issue
Block a user