diff options
author | Eric Andersen | 2001-08-22 05:32:24 +0000 |
---|---|---|
committer | Eric Andersen | 2001-08-22 05:32:24 +0000 |
commit | 5d60a462694ae4ab24fdbc903859949886c90805 (patch) | |
tree | f9c30d311a83b0793bb4f870d9b94833b78aa6f3 | |
parent | ac5dbd193b7d4935d4ad54bc9a7ad6f10b34efa7 (diff) | |
download | busybox-5d60a462694ae4ab24fdbc903859949886c90805.zip busybox-5d60a462694ae4ab24fdbc903859949886c90805.tar.gz |
Fix a warning and potential segfault in lash when BB_FEATURE_CLEAN_UP
is enabled
-rw-r--r-- | lash.c | 4 | ||||
-rw-r--r-- | shell/lash.c | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -1507,8 +1507,8 @@ static int busy_loop(FILE * input) #ifdef BB_FEATURE_CLEAN_UP void free_memory(void) { - if (cwd) { - free(cwd); + if (cwd && cwd!=unknown) { + free((char*)cwd); } if (local_pending_command) free(local_pending_command); diff --git a/shell/lash.c b/shell/lash.c index 0af6691..22e3c77 100644 --- a/shell/lash.c +++ b/shell/lash.c @@ -1507,8 +1507,8 @@ static int busy_loop(FILE * input) #ifdef BB_FEATURE_CLEAN_UP void free_memory(void) { - if (cwd) { - free(cwd); + if (cwd && cwd!=unknown) { + free((char*)cwd); } if (local_pending_command) free(local_pending_command); |