Fixed memory leaks.

This commit is contained in:
Armin Novak 2014-11-16 23:30:31 +01:00
parent 99a26263c7
commit 24f3f0c4a6
1 changed files with 13 additions and 0 deletions

View File

@ -206,7 +206,10 @@ int rdpgfx_recv_reset_graphics_pdu(RDPGFX_CHANNEL_CALLBACK* callback, wStream* s
pad = 340 - (RDPGFX_HEADER_SIZE + 12 + (pdu.monitorCount * 20));
if (Stream_GetRemainingLength(s) < (size_t) pad)
{
free(pdu.monitorDefArray);
return -1;
}
Stream_Seek(s, pad); /* pad (total size is 340 bytes) */
@ -1079,7 +1082,10 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
gfx->SurfaceTable = HashTable_New(TRUE);
if (!gfx->SurfaceTable)
{
free (gfx);
return -1;
}
gfx->ThinClient = gfx->settings->GfxThinClient;
gfx->SmallCache = gfx->settings->GfxSmallCache;
@ -1098,7 +1104,10 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
context = (RdpgfxClientContext*) calloc(1, sizeof(RdpgfxClientContext));
if (!context)
{
free (gfx);
return -1;
}
context->handle = (void*) gfx;
@ -1112,7 +1121,11 @@ int DVCPluginEntry(IDRDYNVC_ENTRY_POINTS* pEntryPoints)
gfx->zgfx = zgfx_context_new(FALSE);
if (!gfx->zgfx)
{
free (gfx);
free (context);
return -1;
}
status = pEntryPoints->RegisterPlugin(pEntryPoints, "rdpgfx", (IWTSPlugin*) gfx);
}