Merge pull request #4423 from akallabeth/double_free

bitmap free now always deallocating all resources.
This commit is contained in:
David Fort 2018-02-13 10:43:49 +01:00 committed by GitHub
commit c44605299f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View File

@ -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)

View File

@ -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,

View File

@ -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)