diff options
author | rmax <rmax@noemail.net> | 2006-01-16 19:31:18 (GMT) |
---|---|---|
committer | rmax <rmax@noemail.net> | 2006-01-16 19:31:18 (GMT) |
commit | bc94046e5b3cf918c740567be71d420871ecde41 (patch) | |
tree | bb4d4c02dd4d0a6f73c6f77b2b41e9d00722e46e /generic/tclPipe.c | |
parent | e8f55bbf6423a18d4a1fb860c9f110590235c4c5 (diff) | |
download | tcl-bc94046e5b3cf918c740567be71d420871ecde41.zip tcl-bc94046e5b3cf918c740567be71d420871ecde41.tar.gz tcl-bc94046e5b3cf918c740567be71d420871ecde41.tar.bz2 |
* generic/tclPipe.c (FileForRedirect): Prevent nameString from
being freed without having been initialized.
* tests/exec.test: Added a test for the above.
FossilOrigin-Name: a4209dcf0bb09fdc9ca4cb7a328e04c02345fae6
Diffstat (limited to 'generic/tclPipe.c')
-rw-r--r-- | generic/tclPipe.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tclPipe.c b/generic/tclPipe.c index 9750131..accfd62 100644 --- a/generic/tclPipe.c +++ b/generic/tclPipe.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: tclPipe.c,v 1.7.2.3 2005/10/05 22:09:11 andreas_kupries Exp $ + * RCS: @(#) $Id: tclPipe.c,v 1.7.2.4 2006/01/16 19:31:18 rmax Exp $ */ #include "tclInt.h" @@ -135,11 +135,10 @@ FileForRedirect(interp, spec, atOK, arg, nextArg, flags, skipPtr, closePtr, *skipPtr = 2; } name = Tcl_TranslateFileName(interp, spec, &nameString); - if (name != NULL) { - file = TclpOpenFile(name, flags); - } else { - file = NULL; + if (name == NULL) { + return NULL; } + file = TclpOpenFile(name, flags); Tcl_DStringFree(&nameString); if (file == NULL) { Tcl_AppendResult(interp, "couldn't ", |