From 7f1ffd126b3eb8156324405a0a1c5b1be74e2218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Thu, 29 Oct 2020 18:03:52 +0100 Subject: [PATCH] module/script: close script communication pipe FD on error --- modules/script.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/script.c b/modules/script.c index 5f21df8..851f153 100644 --- a/modules/script.c +++ b/modules/script.c @@ -450,11 +450,13 @@ run(struct module *mod) if (r < 0) { LOG_ERRNO("failed to read from pipe"); + close(comm_pipe[0]); return -1; } if (r > 0) { LOG_ERRNO_P("%s: failed to start", _errno, m->path); + close(comm_pipe[0]); waitpid(pid, NULL, 0); return -1; }