summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--netio.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/netio.c b/netio.c
index 42d1b32..9c84958 100644
--- a/netio.c
+++ b/netio.c
@@ -169,11 +169,10 @@ struct dropbear_progress_connection *connect_remote(const char* remotehost, cons
snprintf(c->errstring, len, "Error resolving '%s' port '%s'. %s",
remotehost, remoteport, gai_strerror(err));
TRACE(("Error resolving: %s", gai_strerror(err)))
- return NULL;
+ } else {
+ c->res_iter = c->res;
}
- c->res_iter = c->res;
-
return c;
}
@@ -220,7 +219,7 @@ void handle_connect_fds(fd_set *writefd) {
socklen_t vallen = sizeof(val);
struct dropbear_progress_connection *c = iter->item;
- if (!FD_ISSET(c->sock, writefd)) {
+ if (c->sock < 0 || !FD_ISSET(c->sock, writefd)) {
continue;
}