From 95de81c9a7d5f07fb35099a976d60b752bc7ffa8 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 17 Sep 2020 23:46:35 -0500 Subject: [PATCH] kadm5: Avoid close(-1) --- lib/kadm5/destroy_c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/kadm5/destroy_c.c b/lib/kadm5/destroy_c.c index 15e2b5e2a..5ed85f79f 100644 --- a/lib/kadm5/destroy_c.c +++ b/lib/kadm5/destroy_c.c @@ -43,7 +43,8 @@ kadm5_c_destroy(void *server_handle) free(context->realm); free(context->readonly_admin_server); free(context->admin_server); - rk_closesocket(context->sock); + if (context->sock != rk_INVALID_SOCKET) + rk_closesocket(context->sock); if (context->client_name) free(context->client_name); if (context->service_name)