Fix a warning and potential segfault in lash when BB_FEATURE_CLEAN_UP

is enabled
This commit is contained in:
Eric Andersen 2001-08-22 05:32:24 +00:00
parent ac5dbd193b
commit 5d60a46269
2 changed files with 4 additions and 4 deletions

4
lash.c
View File

@ -1507,8 +1507,8 @@ static int busy_loop(FILE * input)
#ifdef BB_FEATURE_CLEAN_UP #ifdef BB_FEATURE_CLEAN_UP
void free_memory(void) void free_memory(void)
{ {
if (cwd) { if (cwd && cwd!=unknown) {
free(cwd); free((char*)cwd);
} }
if (local_pending_command) if (local_pending_command)
free(local_pending_command); free(local_pending_command);

View File

@ -1507,8 +1507,8 @@ static int busy_loop(FILE * input)
#ifdef BB_FEATURE_CLEAN_UP #ifdef BB_FEATURE_CLEAN_UP
void free_memory(void) void free_memory(void)
{ {
if (cwd) { if (cwd && cwd!=unknown) {
free(cwd); free((char*)cwd);
} }
if (local_pending_command) if (local_pending_command)
free(local_pending_command); free(local_pending_command);