summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-02-27 06:39:16 (GMT)
committerhobbs <hobbs>2002-02-27 06:39:16 (GMT)
commitc41330c9d6c97ddc3237c3216c6ea5c543893bfb (patch)
treec5998a4fb94359db285251d09355de2a4ab72833 /generic
parentb599dccc0f6806bcd8ec702b3c9912d6a571c2b0 (diff)
downloadtcl-c41330c9d6c97ddc3237c3216c6ea5c543893bfb.zip
tcl-c41330c9d6c97ddc3237c3216c6ea5c543893bfb.tar.gz
tcl-c41330c9d6c97ddc3237c3216c6ea5c543893bfb.tar.bz2
* generic/tclFileName.c (Tcl_TranslateFileName): decr refcount for
error case to prevent mem leak.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclFileName.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclFileName.c b/generic/tclFileName.c
index 0b698f1..28cd1e2 100644
--- a/generic/tclFileName.c
+++ b/generic/tclFileName.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: tclFileName.c,v 1.31 2002/02/15 14:28:49 dkf Exp $
+ * RCS: @(#) $Id: tclFileName.c,v 1.32 2002/02/27 06:39:16 hobbs Exp $
*/
#include "tclInt.h"
@@ -1339,10 +1339,11 @@ Tcl_TranslateFileName(interp, name, bufferPtr)
{
Tcl_Obj *path = Tcl_NewStringObj(name, -1);
CONST char *result;
-
+
Tcl_IncrRefCount(path);
- result = Tcl_FSGetTranslatedStringPath(interp,path);
+ result = Tcl_FSGetTranslatedStringPath(interp, path);
if (result == NULL) {
+ Tcl_DecrRefCount(path);
return NULL;
}
Tcl_DStringInit(bufferPtr);