From 06e066a49127115b6396b60b52ecd9127baf069d Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Mon, 6 Feb 2017 21:12:12 +0100
Subject: WebSocket: avoid closing an invalid FD
---
json-rpc-shell.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/json-rpc-shell.c b/json-rpc-shell.c
index 3e5f18d..0fbf1ae 100644
--- a/json-rpc-shell.c
+++ b/json-rpc-shell.c
@@ -2126,7 +2126,7 @@ backend_ws_connect (struct ws_context *self, struct error **e)
result = true;
fail_2:
- if (!result)
+ if (!result && self->server_fd != -1)
{
xclose (self->server_fd);
self->server_fd = -1;
--
cgit v1.2.3-70-g09d2