diff options
author | 2005-10-12 05:48:31 +1000 | |
---|---|---|
committer | 2005-10-12 05:48:31 +1000 | |
commit | 93293b355756ee0f677e8d05c566892f56b612ad (patch) | |
tree | 3a8366039ee7efa46e1c8e3aefc11262b70213f2 /complete.c | |
parent | 4ba35b891908adeba74f412bdbf2716e8f58851b (diff) |
Fix invalid free causing hangup and crash in completion code
darcs-hash:20051011194831-ac50b-d9d3a3ccf2c6723b1ca6ac952bc13d37c4759689.gz
Diffstat (limited to 'complete.c')
-rw-r--r-- | complete.c | 10 |
1 files changed, 3 insertions, 7 deletions
@@ -1977,7 +1977,7 @@ void complete( const wchar_t *cmd, int old_error_max = error_max; int done=0; - + error_max=0; /** @@ -1995,7 +1995,6 @@ void complete( const wchar_t *cmd, done=1; } - /* 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 @@ -2021,7 +2020,6 @@ void complete( const wchar_t *cmd, done=1; } - if( !done ) { int had_cmd=0; @@ -2029,8 +2027,6 @@ void complete( const wchar_t *cmd, tok_init( &tok, buff, TOK_ACCEPT_UNFINISHED ); - free( buff ); - while( !end_loop ) { switch( tok_last_type( &tok ) ) @@ -2053,7 +2049,7 @@ void complete( const wchar_t *cmd, case TOK_BACKGROUND: had_cmd=0; break; - + case TOK_ERROR: end_loop=1; @@ -2068,7 +2064,7 @@ void complete( const wchar_t *cmd, } tok_destroy( &tok ); - + free( buff ); /* Get the string to complete |