diff options
author | dgp <dgp@users.sourceforge.net> | 2014-07-11 18:20:42 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-07-11 18:20:42 (GMT) |
commit | 5af71fcbffd57da1e03cc84d9dbe3cc636068629 (patch) | |
tree | a9c909cbf930ec50fcebc70721adc761083ba4bd /unix | |
parent | 431189b805c68785e4237217c47b1dd10a87b7f5 (diff) | |
download | tcl-5af71fcbffd57da1e03cc84d9dbe3cc636068629.zip tcl-5af71fcbffd57da1e03cc84d9dbe3cc636068629.tar.gz tcl-5af71fcbffd57da1e03cc84d9dbe3cc636068629.tar.bz2 |
[1211aceef2] Fix refcount management of TclpTempFileName() that caused leak.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tclUnixPipe.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c index a02044e..95bc8d1 100644 --- a/unix/tclUnixPipe.c +++ b/unix/tclUnixPipe.c @@ -229,7 +229,7 @@ TclpCreateTempFile( Tcl_Obj * TclpTempFileName(void) { - Tcl_Obj *nameObj = Tcl_NewObj(); + Tcl_Obj *retVal, *nameObj = Tcl_NewObj(); int fd; Tcl_IncrRefCount(nameObj); @@ -242,7 +242,9 @@ TclpTempFileName(void) fcntl(fd, F_SETFD, FD_CLOEXEC); TclpObjDeleteFile(nameObj); close(fd); - return nameObj; + retVal = Tcl_DuplicateObj(nameObj); + Tcl_DecrRefCount(nameObj); + return retVal; } /* |