Merge pull request #3054 from akallabeth/leak_fixes_v2

Leak fixes
This commit is contained in:
Martin Fleisz 2016-01-15 09:51:07 +01:00
commit 87c0913aff
4 changed files with 10 additions and 2 deletions

View File

@ -413,6 +413,8 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr)
dev_array[size].path = word;
dev_array[size++].to_add = TRUE;
}
else
free (word);
}
free(line);
}
@ -502,7 +504,7 @@ static UINT handle_hotplug(rdpdrPlugin* rdpdr)
cleanup:
for (i = 0; i < size; i++)
free (dev_array[size].path);
free (dev_array[i].path);
return error ? error : rdpdr_send_device_list_announce_request(rdpdr, TRUE);
}

View File

@ -709,7 +709,10 @@ UINT xf_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* c
surface->codecs = codecs_new((rdpContext*) xfc);
if (!surface->codecs)
{
free (surface);
return CHANNEL_RC_NO_MEMORY;
}
surface->surfaceId = createSurface->surfaceId;
surface->width = (UINT32) createSurface->width;

View File

@ -717,7 +717,10 @@ UINT gdi_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU*
surface->codecs = codecs_new(gdi->context);
if (!surface->codecs)
{
free (surface);
return CHANNEL_RC_NO_MEMORY;
}
surface->surfaceId = createSurface->surfaceId;
surface->width = (UINT32) createSurface->width;

View File

@ -424,7 +424,7 @@ static HANDLE FileCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dw
WINPR_FILE* pFile;
BOOL create;
const char* mode = FileGetMode(dwDesiredAccess, dwCreationDisposition, &create);
int lock;
int lock = 0;
FILE* fp = NULL;
pFile = (WINPR_FILE*) calloc(1, sizeof(WINPR_FILE));