Fix invalid free causing hangup and crash in completion code

darcs-hash:20051011194831-ac50b-d9d3a3ccf2c6723b1ca6ac952bc13d37c4759689.gz
This commit is contained in:
axel 2005-10-12 05:48:31 +10:00
parent 4ba35b8919
commit 93293b3557
2 changed files with 9 additions and 13 deletions

View file

@ -1995,7 +1995,6 @@ void complete( const wchar_t *cmd,
done=1; done=1;
} }
/* /*
Set on_command to true if cursor is over a command, and set the Set on_command to true if cursor is over a command, and set the
name of the current command, and various other parsing to find name of the current command, and various other parsing to find
@ -2021,7 +2020,6 @@ void complete( const wchar_t *cmd,
done=1; done=1;
} }
if( !done ) if( !done )
{ {
int had_cmd=0; int had_cmd=0;
@ -2029,8 +2027,6 @@ void complete( const wchar_t *cmd,
tok_init( &tok, buff, TOK_ACCEPT_UNFINISHED ); tok_init( &tok, buff, TOK_ACCEPT_UNFINISHED );
free( buff );
while( !end_loop ) while( !end_loop )
{ {
switch( tok_last_type( &tok ) ) switch( tok_last_type( &tok ) )
@ -2068,7 +2064,7 @@ void complete( const wchar_t *cmd,
} }
tok_destroy( &tok ); tok_destroy( &tok );
free( buff );
/* /*
Get the string to complete Get the string to complete

View file

@ -2389,7 +2389,7 @@ static int read_i()
wchar_t *reader_readline() wchar_t *reader_readline()
{ {
wchar_t c; wint_t c;
int i; int i;
int last_char=0, yank=0; int last_char=0, yank=0;
wchar_t *yank_str; wchar_t *yank_str;