plug a memleak when freeing io redirection in commands.
authorjaredy <jaredy@openbsd.org>
Mon, 11 Aug 2008 21:50:35 +0000 (21:50 +0000)
committerjaredy <jaredy@openbsd.org>
Mon, 11 Aug 2008 21:50:35 +0000 (21:50 +0000)
the leaked memory is actually reclaimed when the command
finishes but may grow until that happens, e.g. during
command execution.

ok phessler@.
testing sobrado@ jmc@ oga@.

bin/ksh/tree.c

index a9c725b..b46434e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: tree.c,v 1.18 2006/04/10 14:38:59 jaredy Exp $        */
+/*     $OpenBSD: tree.c,v 1.19 2008/08/11 21:50:35 jaredy Exp $        */
 
 /*
  * command tree climbing
@@ -706,4 +706,5 @@ iofree(struct ioword **iow, Area *ap)
                        afree((void*)p->heredoc, ap);
                afree((void*)p, ap);
        }
+       afree(iow, ap);
 }