server/server: fix clang static analyzer warning

Change-Id: I317e189b62540e3688a20d88a95f551280317f14
Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
Reviewed-on: http://openocd.zylin.com/5373
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
This commit is contained in:
Tomas Vanek 2019-12-20 23:40:07 +01:00
parent 35d9bf9917
commit 98a8b99ef3

View File

@ -562,7 +562,7 @@ int server_loop(struct command_context *command_context)
struct connection *c;
for (c = service->connections; c; ) {
if ((FD_ISSET(c->fd, &read_fds)) || c->input_pending) {
if ((c->fd >= 0 && FD_ISSET(c->fd, &read_fds)) || c->input_pending) {
retval = service->input(c);
if (retval != ERROR_OK) {
struct connection *next = c->next;