summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2010-10-20 01:50:18 (GMT)
committerKevin B Kenny <kennykb@acm.org>2010-10-20 01:50:18 (GMT)
commitba272f699236d12685e8a297303f71d9fe87080f (patch)
tree012aca108d2e4e279dd830e7c202ea1add3fa5aa /unix
parent9fd96b030f9ba4e30d0631ffa6d020089d507a02 (diff)
downloadtcl-ba272f699236d12685e8a297303f71d9fe87080f.zip
tcl-ba272f699236d12685e8a297303f71d9fe87080f.tar.gz
tcl-ba272f699236d12685e8a297303f71d9fe87080f.tar.bz2
merge
Diffstat (limited to 'unix')
-rw-r--r--unix/.cvsignore1
-rw-r--r--unix/tclUnixSock.c22
2 files changed, 7 insertions, 16 deletions
diff --git a/unix/.cvsignore b/unix/.cvsignore
index 84db0f4..735f9d7 100644
--- a/unix/.cvsignore
+++ b/unix/.cvsignore
@@ -20,3 +20,4 @@ confdefs.h
pkg
*.dll
xttest
+test3
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c
index 4acee20..a4d672d 100644
--- a/unix/tclUnixSock.c
+++ b/unix/tclUnixSock.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixSock.c,v 1.26.2.1 2010/09/28 15:43:01 kennykb Exp $
+ * RCS: @(#) $Id: tclUnixSock.c,v 1.26.2.2 2010/10/20 01:50:19 kennykb Exp $
*/
#include "tclInt.h"
@@ -867,7 +867,7 @@ CreateClientSocket(
* attempt to do an async connect. Otherwise
* do a synchronous connect or bind. */
{
- int status = 0, connected = 0, sock = -1;
+ int status = -1, connected = 0, sock = -1;
struct addrinfo *addrlist = NULL, *addrPtr;
/* Socket address */
struct addrinfo *myaddrlist = NULL, *myaddrPtr;
@@ -968,14 +968,11 @@ CreateClientSocket(
status = TclUnixSetBlockingMode(sock, TCL_MODE_BLOCKING);
}
+error:
+ freeaddrinfo(addrlist);
+ freeaddrinfo(myaddrlist);
+
if (status < 0) {
- error:
- if (addrlist != NULL) {
- freeaddrinfo(addrlist);
- }
- if (myaddrlist != NULL) {
- freeaddrinfo(myaddrlist);
- }
if (interp != NULL) {
Tcl_AppendResult(interp, "couldn't open socket: ",
Tcl_PosixError(interp), NULL);
@@ -989,13 +986,6 @@ CreateClientSocket(
return NULL;
}
- if (addrlist == NULL) {
- freeaddrinfo(addrlist);
- }
- if (myaddrlist == NULL) {
- freeaddrinfo(myaddrlist);
- }
-
/*
* Allocate a new TcpState for this socket.
*/