mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
Fixed a memory leak in cleaning up brushes.
This commit is contained in:
@@ -663,9 +663,7 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!hbrush)
|
||||
gdi_DeleteObject((HGDIOBJECT) hBmp);
|
||||
else
|
||||
if (hbrush)
|
||||
{
|
||||
hbrush->nXOrg = brush->x;
|
||||
hbrush->nYOrg = brush->y;
|
||||
@@ -676,6 +674,7 @@ static BOOL gdi_patblt(rdpContext* context, PATBLT_ORDER* patblt)
|
||||
}
|
||||
|
||||
out_error:
|
||||
gdi_DeleteObject((HGDIOBJECT) hBmp);
|
||||
gdi_DeleteObject((HGDIOBJECT) hbrush);
|
||||
gdi->drawing->hdc->brush = originalBrush;
|
||||
gdi_SetTextColor(gdi->drawing->hdc, originalColor);
|
||||
@@ -933,6 +932,7 @@ static BOOL gdi_mem3blt(rdpContext* context, MEM3BLT_ORDER* mem3blt)
|
||||
mem3blt->nXSrc, mem3blt->nYSrc, gdi_rop3_code(mem3blt->bRop),
|
||||
&gdi->palette);
|
||||
gdi_DeleteObject((HGDIOBJECT) gdi->drawing->hdc->brush);
|
||||
gdi_DeleteObject((HGDIOBJECT) hBmp);
|
||||
gdi->drawing->hdc->brush = originalBrush;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user