Plug another memory leak in hush. This one showed up when backticked
authorEric Andersen <andersen@codepoet.org>
Wed, 23 May 2001 23:46:09 +0000 (23:46 -0000)
committerEric Andersen <andersen@codepoet.org>
Wed, 23 May 2001 23:46:09 +0000 (23:46 -0000)
commands were run.  This one was sure a bugger to find.
 -Erik

hush.c
shell/hush.c

diff --git a/hush.c b/hush.c
index 57b85d1bc5574fbb30c8719a96a8079219acab57..bb139717956cff2340c81aec2c8aeeb0fc72692c 100644 (file)
--- a/hush.c
+++ b/hush.c
@@ -2166,6 +2166,7 @@ static int process_command_subs(o_string *dest, struct p_context *ctx, struct in
         * to the KISS philosophy of this program. */
        mark_closed(fileno(p));
        retcode=pclose(p);
+       free_pipe_list(inner.list_head,0);
        debug_printf("pclosed, retcode=%d\n",retcode);
        /* XXX this process fails to trim a single trailing newline */
        return retcode;
index 57b85d1bc5574fbb30c8719a96a8079219acab57..bb139717956cff2340c81aec2c8aeeb0fc72692c 100644 (file)
@@ -2166,6 +2166,7 @@ static int process_command_subs(o_string *dest, struct p_context *ctx, struct in
         * to the KISS philosophy of this program. */
        mark_closed(fileno(p));
        retcode=pclose(p);
+       free_pipe_list(inner.list_head,0);
        debug_printf("pclosed, retcode=%d\n",retcode);
        /* XXX this process fails to trim a single trailing newline */
        return retcode;