fix memory leaks.

This commit is contained in:
Vic Lee 2011-09-07 14:19:11 +08:00
parent b8e16bb1c1
commit 53ccc4c013
7 changed files with 16 additions and 2 deletions

View File

@ -336,7 +336,7 @@ boolean xf_pre_connect(freerdp* instance)
xf_kbd_init(xfi); xf_kbd_init(xfi);
xfi->clrconv = (HCLRCONV) malloc(sizeof(CLRCONV)); xfi->clrconv = xnew(CLRCONV);
xfi->clrconv->palette = NULL; xfi->clrconv->palette = NULL;
xfi->clrconv->alpha = 1; xfi->clrconv->alpha = 1;
xfi->clrconv->invert = 0; xfi->clrconv->invert = 0;
@ -568,6 +568,9 @@ void xf_window_free(xfInfo* xfi)
cache_free(xfi->cache); cache_free(xfi->cache);
xfi->cache = NULL; xfi->cache = NULL;
} }
xfree(xfi->clrconv);
rail_free(xfi->rail);
} }
void xf_free(xfInfo* xfi) void xf_free(xfInfo* xfi)

View File

@ -108,6 +108,8 @@ void brush_free(rdpBrush* brush)
{ {
if (brush != NULL) if (brush != NULL)
{ {
xfree(brush->entries);
xfree(brush->monoEntries);
xfree(brush); xfree(brush);
} }
} }

View File

@ -76,6 +76,7 @@ void color_table_free(rdpColorTable* color_table)
{ {
if (color_table != NULL) if (color_table != NULL)
{ {
xfree(color_table->entries);
xfree(color_table); xfree(color_table);
} }
} }

View File

@ -148,5 +148,9 @@ freerdp* freerdp_new()
void freerdp_free(freerdp* freerdp) void freerdp_free(freerdp* freerdp)
{ {
xfree(freerdp); if (freerdp)
{
rdp_free(freerdp->rdp);
xfree(freerdp);
}
} }

View File

@ -182,6 +182,7 @@ int gdi_DeleteDC(HGDI_DC hdc)
{ {
if (hdc->hwnd) if (hdc->hwnd)
{ {
free(hdc->hwnd->cinvalid);
free(hdc->hwnd->invalid); free(hdc->hwnd->invalid);
free(hdc->hwnd); free(hdc->hwnd);
} }

View File

@ -885,6 +885,8 @@ void gdi_surface_bits(rdpUpdate* update, SURFACE_BITS_COMMAND* surface_bits_comm
{ {
printf("Unsupported codecID %d\n", surface_bits_command->codecID); printf("Unsupported codecID %d\n", surface_bits_command->codecID);
} }
xfree(tile_bitmap);
} }
/** /**

View File

@ -151,6 +151,7 @@ void rail_free(rdpRail* rail)
icon_cache_free(rail->cache); icon_cache_free(rail->cache);
window_list_free(rail->list); window_list_free(rail->list);
freerdp_uniconv_free(rail->uniconv); freerdp_uniconv_free(rail->uniconv);
xfree(rail->clrconv);
xfree(rail); xfree(rail);
} }
} }