diff options
author | das <das@noemail.net> | 2007-09-17 11:38:14 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2007-09-17 11:38:14 (GMT) |
commit | cfbe832f6235fe00d5195fdb00352a6b41dd8137 (patch) | |
tree | 992f2d7a8607d531a4e145e8e5ccf8a183c72dc9 /unix | |
parent | 730ebdfbd62abc90d1b896c18a9fdc5a46d1ce81 (diff) | |
download | tcl-cfbe832f6235fe00d5195fdb00352a6b41dd8137.zip tcl-cfbe832f6235fe00d5195fdb00352a6b41dd8137.tar.gz tcl-cfbe832f6235fe00d5195fdb00352a6b41dd8137.tar.bz2 |
coverity id 102
FossilOrigin-Name: 1df1261457d08db61e9a8df3ef7b21e44c0cf8d0
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixChan.c | 17 |
1 files 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); } /* |