From ddfbf28cd4be4beef34a45970751db4f58926c38 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 5 Jan 2025 17:52:36 +0000 Subject: [PATCH] htmlroff: fix tcs pipe leak --- sys/src/cmd/htmlroff/char.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/htmlroff/char.c b/sys/src/cmd/htmlroff/char.c index 7a1bc6a8b..47e99d332 100644 --- a/sys/src/cmd/htmlroff/char.c +++ b/sys/src/cmd/htmlroff/char.c @@ -33,14 +33,15 @@ rune2html(Rune r) sysfatal("fork: %r"); case 0: dup(p[0], 0); - dup(p[1], 1); + dup(p[0], 1); close(p[0]); close(p[1]); execl("/bin/tcs", "tcs", "-t", "html", nil); _exits(0); default: + close(p[0]); fd = p[1]; - Binit(&b, p[0], OREAD); + Binit(&b, fd, OREAD); break; } }