summaryrefslogtreecommitdiff
path: root/ssh-pkcs11-client.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-pkcs11-client.c')
-rw-r--r--ssh-pkcs11-client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ssh-pkcs11-client.c b/ssh-pkcs11-client.c
index a79c8721..fc758282 100644
--- a/ssh-pkcs11-client.c
+++ b/ssh-pkcs11-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11-client.c,v 1.7 2017/05/30 08:52:19 markus Exp $ */
+/* $OpenBSD: ssh-pkcs11-client.c,v 1.8 2018/02/05 05:37:46 tb Exp $ */
/*
* Copyright (c) 2010 Markus Friedl. All rights reserved.
*
@@ -99,7 +99,8 @@ pkcs11_init(int interactive)
void
pkcs11_terminate(void)
{
- close(fd);
+ if (fd >= 0)
+ close(fd);
}
static int