From 1ee91334601ef274827664f2c387998fdbfc99eb Mon Sep 17 00:00:00 2001 From: dgp Date: Thu, 28 Oct 2010 16:22:36 +0000 Subject: * unix/tclUnixSock.c: Prevent calls freeaddrinfo(NULL) which can crash some systems. Thanks Larry Virden. [Bug 3093120] --- ChangeLog | 5 +++++ unix/tclUnixSock.c | 10 +++++++--- 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 + + * unix/tclUnixSock.c: Prevent calls freeaddrinfo(NULL) which can + crash some systems. Thanks Larry Virden. [Bug 3093120] + 2010-10-26 Reinhard Max * 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) { -- cgit v0.12