aboutsummaryrefslogtreecommitdiff
path: root/tests/pkd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-01-14 10:45:41 +0100
committerAndreas Schneider <asn@cryptomilk.org>2015-01-14 15:20:43 +0100
commit68e720a3dab575c5b5f68c70a14004ba0bd1dc54 (patch)
treeb4f56682f8f76a728d07d4b51937d1dd9e74b134 /tests/pkd
parentc224508bf88d3ed683b86659f9856272150135f8 (diff)
downloadlibssh-68e720a3dab575c5b5f68c70a14004ba0bd1dc54.tar.gz
libssh-68e720a3dab575c5b5f68c70a14004ba0bd1dc54.tar.xz
libssh-68e720a3dab575c5b5f68c70a14004ba0bd1dc54.zip
pkd: Make sure we do not pass -1 to close.
CID: #1245696 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Aris Adamantiadis <aris@0xbadc0de.be>
Diffstat (limited to 'tests/pkd')
-rw-r--r--tests/pkd/pkd_daemon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/pkd/pkd_daemon.c b/tests/pkd/pkd_daemon.c
index 07736fa6..61582b5a 100644
--- a/tests/pkd/pkd_daemon.c
+++ b/tests/pkd/pkd_daemon.c
@@ -451,7 +451,9 @@ static void *pkd_main(void *args) {
}
}
- close(pkd_state.server_fd);
+ if (pkd_state.server_fd != -1) {
+ close(pkd_state.server_fd);
+ }
pkd_state.server_fd = -1;
out:
ctx.rc = rc;