diff options
author | rmax <rmax@noemail.net> | 2006-01-16 19:38:15 (GMT) |
---|---|---|
committer | rmax <rmax@noemail.net> | 2006-01-16 19:38:15 (GMT) |
commit | 7a43e034bda4ac9b9b061ddea8173032e50096ba (patch) | |
tree | 486cebf175fe6337e67e436ad7775e69b84d5e20 /generic/tclPipe.c | |
parent | 9f3224dddb2ee531439a5bc3c52d5ba320823167 (diff) | |
download | tcl-7a43e034bda4ac9b9b061ddea8173032e50096ba.zip tcl-7a43e034bda4ac9b9b061ddea8173032e50096ba.tar.gz tcl-7a43e034bda4ac9b9b061ddea8173032e50096ba.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: 989ec0249aca7b3f634575384856080d91dc7c6c
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 3cec10c..b02d91b 100644 --- a/generic/tclPipe.c +++ b/generic/tclPipe.c @@ -9,7 +9,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.16 2005/11/07 08:56:27 dkf Exp $ + * RCS: @(#) $Id: tclPipe.c,v 1.17 2006/01/16 19:38:15 rmax Exp $ */ #include "tclInt.h" @@ -128,11 +128,10 @@ FileForRedirect( *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 ", |