mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
Fix a warning and potential segfault in lash when BB_FEATURE_CLEAN_UP
is enabled
This commit is contained in:
parent
ac5dbd193b
commit
5d60a46269
4
lash.c
4
lash.c
@ -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);
|
||||||
|
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user