coverity scan reported couple of issues for pinentry package. The should be addressed with the following patch-set:
Couple of them are hopefully obvious., but I was not sure with the following one:
Error: USE_AFTER_FREE (CWE-672): [#def9]
pinentry-1.1.1/tty/pinentry-tty.c:555: freed_arg: "fclose" frees "ttyfi".
pinentry-1.1.1/tty/pinentry-tty.c:562: use_closed_file: Calling "fileno" uses file handle "ttyfi" after closing it.
# 560| }
# 561|
# 562|-> if (terminal_save (fileno (ttyfi)) < 0)
# 563| rc = -1;
# 564|
Error: CPPCHECK_WARNING (CWE-415): [#def10]
pinentry-1.1.1/tty/pinentry-tty.c:588: error[doubleFree]: Resource handle 'ttyfi' freed twice.
# 586| if (pinentry->ttyname)
# 587| {
# 588|-> fclose (ttyfi);
# 589| fclose (ttyfo);
# 590| }