diff options
author | dgp <dgp@users.sourceforge.net> | 2010-10-28 16:22:36 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2010-10-28 16:22:36 (GMT) |
commit | 1ee91334601ef274827664f2c387998fdbfc99eb (patch) | |
tree | a7b9620de2e2b85d30034151df5b3e5145ba2f71 /unix/tclUnixSock.c | |
parent | b34958c4c8cb2098a29a7b9a2a867c814bbd6592 (diff) | |
download | tcl-1ee91334601ef274827664f2c387998fdbfc99eb.zip tcl-1ee91334601ef274827664f2c387998fdbfc99eb.tar.gz tcl-1ee91334601ef274827664f2c387998fdbfc99eb.tar.bz2 |
* unix/tclUnixSock.c: Prevent calls freeaddrinfo(NULL) which can
crash some systems. Thanks Larry Virden. [Bug 3093120]
Diffstat (limited to 'unix/tclUnixSock.c')
-rw-r--r-- | unix/tclUnixSock.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/unix/tclUnixSock.c b/unix/tclUnixSock.c index 3455e29..b3461e3 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.30 2010/10/26 13:59:28 dkf Exp $ + * RCS: @(#) $Id: tclUnixSock.c,v 1.31 2010/10/28 16:22:37 dgp Exp $ */ #include "tclInt.h" @@ -972,8 +972,12 @@ CreateClientSocket( } error: - freeaddrinfo(addrlist); - freeaddrinfo(myaddrlist); + if (addrlist) { + freeaddrinfo(addrlist); + } + if (myaddrlist) { + freeaddrinfo(myaddrlist); + } if (status < 0) { if (interp != NULL) { |