handledcgi: close file descriptor if opening a stream for fdopen fails - geomyidae - A small C-based gopherd. HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 2ea7fc9967866e29f459515cbac7e03ce10e23a4 DIR parent e052ad155391912e86548bcb9ba9bac65dde7879 HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org> Date: Sun, 19 Mar 2023 18:52:01 +0100 handledcgi: close file descriptor if opening a stream for fdopen fails Signed-off-by: Christoph Lohmann <20h@r-36.net> Diffstat: M handlr.c | 1 + 1 file changed, 1 insertion(+), 0 deletions(-) --- DIR diff --git a/handlr.c b/handlr.c @@ -245,6 +245,7 @@ handledcgi(int sock, char *file, char *port, char *base, char *args, if (!(fp = fdopen(outpipe[0], "r"))) { perror("fdopen"); + close(outpipe[0]); break; }