summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2001-03-06 20:44:39 +0000
committerEric Andersen2001-03-06 20:44:39 +0000
commit54851d3c6523b544c127fa0420e4b58fb1f046f4 (patch)
tree360c6764e2931f9f14f31b4a6fd90585d9d256b4
parent07f2f3917a08eea89953c8f0c3f1bc6ef52879b4 (diff)
downloadbusybox-54851d3c6523b544c127fa0420e4b58fb1f046f4.zip
busybox-54851d3c6523b544c127fa0420e4b58fb1f046f4.tar.gz
Fixed a memory leak in lash. It seems that close_all was calling close()
directly instead of calling mark_closed(), which allowed the memory allocated by mark_open() to never be freed. -Erik
-rw-r--r--lash.c2
-rw-r--r--sh.c2
-rw-r--r--shell/lash.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/lash.c b/lash.c
index 57d969e..11016a0 100644
--- a/lash.c
+++ b/lash.c
@@ -632,7 +632,7 @@ static void close_all()
{
struct close_me *c;
for (c=close_me_head; c; c=c->next) {
- close(c->fd);
+ mark_closed(c->fd);
}
close_me_head = NULL;
}
diff --git a/sh.c b/sh.c
index 57d969e..11016a0 100644
--- a/sh.c
+++ b/sh.c
@@ -632,7 +632,7 @@ static void close_all()
{
struct close_me *c;
for (c=close_me_head; c; c=c->next) {
- close(c->fd);
+ mark_closed(c->fd);
}
close_me_head = NULL;
}
diff --git a/shell/lash.c b/shell/lash.c
index 57d969e..11016a0 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -632,7 +632,7 @@ static void close_all()
{
struct close_me *c;
for (c=close_me_head; c; c=c->next) {
- close(c->fd);
+ mark_closed(c->fd);
}
close_me_head = NULL;
}