Make sure the right error is reported later, if all socket() calls fail.

If we close the invalid sock, we'll report EBADF later in that case.
This commit is contained in:
is 2006-03-01 15:39:00 +00:00
parent b948e12637
commit 2de2502171
1 changed files with 3 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sshconnect.c,v 1.33 2006/03/01 15:18:09 is Exp $ */
/* $NetBSD: sshconnect.c,v 1.34 2006/03/01 15:39:00 is Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@ -15,7 +15,7 @@
#include "includes.h"
RCSID("$OpenBSD: sshconnect.c,v 1.171 2005/12/06 22:38:27 reyk Exp $");
__RCSID("$NetBSD: sshconnect.c,v 1.33 2006/03/01 15:18:09 is Exp $");
__RCSID("$NetBSD: sshconnect.c,v 1.34 2006/03/01 15:39:00 is Exp $");
#include <openssl/bn.h>
@ -175,6 +175,7 @@ ssh_create_socket(int privileged, struct addrinfo *ai)
default:
error("socket: %.100s", strerror(errno));
}
return -1;
}
/* Bind the socket to an alternative local IP address */