Fixed a memory leak in lash. It seems that close_all was calling close()
authorEric Andersen <andersen@codepoet.org>
Tue, 6 Mar 2001 20:44:39 +0000 (20:44 -0000)
committerEric Andersen <andersen@codepoet.org>
Tue, 6 Mar 2001 20:44:39 +0000 (20:44 -0000)
directly instead of calling mark_closed(), which allowed the memory allocated
by mark_open() to never be freed.
 -Erik

lash.c
sh.c
shell/lash.c

diff --git a/lash.c b/lash.c
index 57d969e..11016a0 100644 (file)
--- 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 (file)
--- 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;
 }
index 57d969e..11016a0 100644 (file)
@@ -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;
 }