Cleanup and initialization checks.

This commit is contained in:
Armin Novak 2017-12-12 10:47:17 +01:00
parent 7305828122
commit ae2a96293b
2 changed files with 12 additions and 22 deletions

View File

@ -160,14 +160,9 @@ static int test_gdi_ClipCoords(void)
rc = 0;
fail:
if (rgn1)
gdi_DeleteObject((HGDIOBJECT)rgn1);
if (rgn2)
gdi_DeleteObject((HGDIOBJECT)rgn2);
if (bmp)
gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteObject((HGDIOBJECT)rgn1);
gdi_DeleteObject((HGDIOBJECT)rgn2);
gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteDC(hdc);
return rc;
@ -332,14 +327,9 @@ static int test_gdi_InvalidateRegion(void)
rc = 0;
fail:
if (rgn1)
gdi_DeleteObject((HGDIOBJECT)rgn1);
if (rgn2)
gdi_DeleteObject((HGDIOBJECT)rgn2);
if (bmp)
gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteObject((HGDIOBJECT)rgn1);
gdi_DeleteObject((HGDIOBJECT)rgn2);
gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteDC(hdc);
return 0;

View File

@ -184,12 +184,12 @@ static int sspi_ContextBufferAllocTableGrow(void)
static void sspi_ContextBufferAllocTableFree(void)
{
if (ContextBufferAllocTable.cEntries == 0)
{
ContextBufferAllocTable.cEntries = ContextBufferAllocTable.cMaxEntries = 0;
free(ContextBufferAllocTable.entries);
ContextBufferAllocTable.entries = NULL;
}
if (ContextBufferAllocTable.cEntries != 0)
WLog_ERR(TAG, "ContextBufferAllocTable.entries == %"PRIu32, ContextBufferAllocTable.cEntries);
ContextBufferAllocTable.cEntries = ContextBufferAllocTable.cMaxEntries = 0;
free(ContextBufferAllocTable.entries);
ContextBufferAllocTable.entries = NULL;
}
static void* sspi_ContextBufferAlloc(UINT32 allocatorIndex, size_t size)