diff options
author | das <das> | 2007-09-17 11:38:14 (GMT) |
---|---|---|
committer | das <das> | 2007-09-17 11:38:14 (GMT) |
commit | a7dee15a2f5e2bfc9ddc2d1bac7db2b82425aa3d (patch) | |
tree | 992f2d7a8607d531a4e145e8e5ccf8a183c72dc9 /unix | |
parent | 5019c188e504d1080f987c0391048458abef7fc9 (diff) | |
download | tcl-a7dee15a2f5e2bfc9ddc2d1bac7db2b82425aa3d.zip tcl-a7dee15a2f5e2bfc9ddc2d1bac7db2b82425aa3d.tar.gz tcl-a7dee15a2f5e2bfc9ddc2d1bac7db2b82425aa3d.tar.bz2 |
coverity id 102
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); } /* |