Fixed memory leaks.

This commit is contained in:
Armin Novak 2014-11-16 16:02:28 +01:00
parent 6196eb81b2
commit b9908af64a
3 changed files with 7 additions and 2 deletions

View File

@ -672,7 +672,10 @@ BOOL VCAPITYPE VirtualChannelEntry(PCHANNEL_ENTRY_POINTS pEntryPoints)
context = (DrdynvcClientContext*) calloc(1, sizeof(DrdynvcClientContext));
if (!context)
{
free(drdynvc);
return -1;
}
context->handle = (void*) drdynvc;
context->custom = NULL;

View File

@ -190,6 +190,7 @@ void wl_begin_paint(rdpContext* context)
void wl_end_paint(rdpContext* context)
{
char *data;
rdpGdi* gdi;
struct display* display;
struct window* window;
@ -203,7 +204,7 @@ void wl_end_paint(rdpContext* context)
display = context_w->display;
window = context_w->window;
data = realloc(window->data, gdi->width * gdi->height * 4));
data = realloc(window->data, gdi->width * gdi->height * 4);
if (!data)
{

View File

@ -366,7 +366,7 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge)
// check if this value is in the mergeStrings
foundMerge = 0;
ULONG old_offset = offset;
for (run = 0; run < mergeStringLength; run ++)
{
if (!mergeStrings[run])
@ -401,6 +401,7 @@ LPCH MergeEnvironmentStrings(PCSTR original, PCSTR merge)
return NULL;
}
lpszEnvironmentBlock = tmp;
p = &(lpszEnvironmentBlock[old_offset]);
}
foundMerge = 1;