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,13 +160,8 @@ static int test_gdi_ClipCoords(void)
rc = 0; rc = 0;
fail: fail:
if (rgn1)
gdi_DeleteObject((HGDIOBJECT)rgn1); gdi_DeleteObject((HGDIOBJECT)rgn1);
if (rgn2)
gdi_DeleteObject((HGDIOBJECT)rgn2); gdi_DeleteObject((HGDIOBJECT)rgn2);
if (bmp)
gdi_DeleteObject((HGDIOBJECT)bmp); gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteDC(hdc); gdi_DeleteDC(hdc);
@ -332,13 +327,8 @@ static int test_gdi_InvalidateRegion(void)
rc = 0; rc = 0;
fail: fail:
if (rgn1)
gdi_DeleteObject((HGDIOBJECT)rgn1); gdi_DeleteObject((HGDIOBJECT)rgn1);
if (rgn2)
gdi_DeleteObject((HGDIOBJECT)rgn2); gdi_DeleteObject((HGDIOBJECT)rgn2);
if (bmp)
gdi_DeleteObject((HGDIOBJECT)bmp); gdi_DeleteObject((HGDIOBJECT)bmp);
gdi_DeleteDC(hdc); gdi_DeleteDC(hdc);

View File

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