Fix major memory leak in highlighting code and a minor leak in the parser

darcs-hash:20060528110630-ac50b-94a83ec6731b39ebcf864b7491ec3c372e28a135.gz
This commit is contained in:
axel
2006-05-28 21:06:30 +10:00
parent 9f14d50974
commit 79b466441b
2 changed files with 4 additions and 1 deletions

View File

@@ -544,6 +544,9 @@ int output_color_code( const wchar_t *val )
} }
al_foreach( &el, (void (*)(const void *))&free );
al_destroy( &el );
return color | (is_bold?FISH_COLOR_BOLD:0); return color | (is_bold?FISH_COLOR_BOLD:0);
} }

View File

@@ -1976,7 +1976,7 @@ static int parse_job( process_t *p,
tmp = (wchar_t *)al_get( args, 0 ); tmp = (wchar_t *)al_get( args, 0 );
al_truncate( args, 0 ); al_truncate( args, 0 );
al_push( args, wcsdup( L"cd" ) ); al_push( args, halloc_wcsdup( j, L"cd" ) );
al_push( args, tmp ); al_push( args, tmp );
/* /*
If we have defined a wrapper around cd, use it, If we have defined a wrapper around cd, use it,