commit | 132f51d41b7d3d2b34753fa2a0693c5067438c31 | [log] [tgz] |
---|---|---|
author | Stefan Berger <stefanb@linux.ibm.com> | Tue Aug 16 07:51:36 2022 -0400 |
committer | Stefan Berger <stefanb@us.ibm.com> | Tue Aug 16 09:00:42 2022 -0400 |
tree | 9a2e993d5e6544305d8735c1df5403328fc88a29 | |
parent | 841b9319e89967dec675003fa4e83f6186753906 [diff] |
swtpm_ioctl: Only close file descriptor if >= 0 (Coverity) Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
diff --git a/src/swtpm_ioctl/tpm_ioctl.c b/src/swtpm_ioctl/tpm_ioctl.c index 9c26add..9eb785c 100644 --- a/src/swtpm_ioctl/tpm_ioctl.c +++ b/src/swtpm_ioctl/tpm_ioctl.c
@@ -1316,7 +1316,8 @@ exit: free(tcp_hostname); - close(fd); + if (fd >= 0) + close(fd); return ret; }