module/script: close script communication pipe FD on error

This commit is contained in:
Daniel Eklöf 2020-10-29 18:03:52 +01:00
parent fb0d443e1d
commit 7f1ffd126b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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;
}