summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2010-10-28 16:22:36 (GMT)
committerdgp <dgp@users.sourceforge.net>2010-10-28 16:22:36 (GMT)
commit1ee91334601ef274827664f2c387998fdbfc99eb (patch)
treea7b9620de2e2b85d30034151df5b3e5145ba2f71
parentb34958c4c8cb2098a29a7b9a2a867c814bbd6592 (diff)
downloadtcl-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]
-rw-r--r--ChangeLog5
-rw-r--r--unix/tclUnixSock.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 6303af2..c08dabe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-10-28 Don Porter <dgp@users.sourceforge.net>
+
+ * unix/tclUnixSock.c: Prevent calls freeaddrinfo(NULL) which can
+ crash some systems. Thanks Larry Virden. [Bug 3093120]
+
2010-10-26 Reinhard Max <max@suse.de>
* Changelog.2008: Split off from Changelog.
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) {