From a7dee15a2f5e2bfc9ddc2d1bac7db2b82425aa3d Mon Sep 17 00:00:00 2001 From: das Date: Mon, 17 Sep 2007 11:38:14 +0000 Subject: coverity id 102 --- unix/tclUnixChan.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 34f85fb..15629a2 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixChan.c,v 1.81 2007/07/31 08:23:07 dkf Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.82 2007/09/17 11:38:14 das Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -2633,11 +2633,7 @@ CreateSocketAddress( Tcl_DString ds; const char *native; - if (host == NULL) { - native = NULL; - } else { - native = Tcl_UtfToExternalDString(NULL, host, -1, &ds); - } + native = Tcl_UtfToExternalDString(NULL, host, -1, &ds); addr.s_addr = inet_addr(native); /* INTL: Native. */ /* @@ -2655,18 +2651,13 @@ CreateSocketAddress( errno = ENXIO; #endif /* ENXIO */ #endif /* EHOSTUNREACH */ - if (native != NULL) { - Tcl_DStringFree(&ds); - } + Tcl_DStringFree(&ds); return 0; /* Error. */ } - memcpy(&addr, (void *) hostent->h_addr_list[0], (size_t) hostent->h_length); } - if (native != NULL) { - Tcl_DStringFree(&ds); - } + Tcl_DStringFree(&ds); } /* -- cgit v0.12