From df7358712269ad2a9f39687014266f34db60918d Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 22 Aug 2001 05:32:45 +0000 Subject: [PATCH] Backport lash fix --- busybox/lash.c | 4 ++-- busybox/shell/lash.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/busybox/lash.c b/busybox/lash.c index 0af669116..22e3c779e 100644 --- a/busybox/lash.c +++ b/busybox/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); diff --git a/busybox/shell/lash.c b/busybox/shell/lash.c index 0af669116..22e3c779e 100644 --- a/busybox/shell/lash.c +++ b/busybox/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); -- 2.25.1