From d731926be1b26fc8740f5efe657123f84619937a Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Thu, 15 Apr 2021 11:44:38 +0200 Subject: [PATCH] Fixed one more corner case in tty pinentry --- pinentry-1.1.1-coverity.patch | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pinentry-1.1.1-coverity.patch b/pinentry-1.1.1-coverity.patch index 8df88f5..9f10278 100644 --- a/pinentry-1.1.1-coverity.patch +++ b/pinentry-1.1.1-coverity.patch @@ -130,3 +130,13 @@ index 4a2b67f..63e306f 100644 { if (terminal_setup (fileno (ttyfi), !!pinentry->pin) == -1) { +@@ -583,7 +583,8 @@ tty_cmd_handler (pinentry_t pinentry) + if (pinentry->ttyname) + { + fclose (ttyfi); +- fclose (ttyfo); ++ if (ttyfo) ++ fclose (ttyfo); + } + + return rc;