mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-25 06:41:15 -03:00
Remove two minor memory leaks
darcs-hash:20060514223903-ac50b-4e764c460effd8c45493acfe5682626c3711c77e.gz
This commit is contained in:
@@ -1422,7 +1422,6 @@ static int builtin_read( wchar_t **argv )
|
||||
case L'?':
|
||||
builtin_print_help( argv[0], sb_err );
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
10
complete.c
10
complete.c
@@ -1983,7 +1983,8 @@ void complete( const wchar_t *cmd,
|
||||
{
|
||||
if( parser_is_subcommand( tok_last( &tok ) ) )
|
||||
break;
|
||||
|
||||
|
||||
free( current_command );
|
||||
current_command = wcsdup( tok_last( &tok ) );
|
||||
|
||||
on_command = (pos <= tok_get_pos( &tok) + wcslen( tok_last( &tok ) ) );
|
||||
@@ -2050,11 +2051,12 @@ void complete( const wchar_t *cmd,
|
||||
}
|
||||
}
|
||||
|
||||
free( current_token );
|
||||
free( current_command );
|
||||
free( prev_token );
|
||||
}
|
||||
|
||||
free( current_token );
|
||||
free( current_command );
|
||||
free( prev_token );
|
||||
|
||||
error_max=old_error_max;
|
||||
condition_cache_clear();
|
||||
|
||||
|
||||
7
parser.c
7
parser.c
@@ -2107,12 +2107,13 @@ static int parse_job( process_t *p,
|
||||
{
|
||||
|
||||
int end_pos = end-tok_string( tok );
|
||||
wchar_t *sub_block= wcsndup( tok_string( tok ) + current_tokenizer_pos,
|
||||
end_pos - current_tokenizer_pos);
|
||||
wchar_t *sub_block= halloc_wcsndup( j,
|
||||
tok_string( tok ) + current_tokenizer_pos,
|
||||
end_pos - current_tokenizer_pos);
|
||||
|
||||
p->type = INTERNAL_BLOCK;
|
||||
al_set( args, 0, sub_block );
|
||||
|
||||
|
||||
tok_set_pos( tok,
|
||||
end_pos );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user