diff options
author | hershey <hershey> | 1999-06-10 19:14:54 (GMT) |
---|---|---|
committer | hershey <hershey> | 1999-06-10 19:14:54 (GMT) |
commit | a1bbc1ac05acbe4053d7f8fab4555437acbc9c5c (patch) | |
tree | 0936338ce74c43e4f554ffe9610b9e8976c2f7c5 | |
parent | 7d849078f78a84680ee3d12ee9146dbfc4aaf54b (diff) | |
download | tcl-a1bbc1ac05acbe4053d7f8fab4555437acbc9c5c.zip tcl-a1bbc1ac05acbe4053d7f8fab4555437acbc9c5c.tar.gz tcl-a1bbc1ac05acbe4053d7f8fab4555437acbc9c5c.tar.bz2 |
fied a memory leak. purify nolonger complains.
-rw-r--r-- | generic/tclUnicodeObj.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/generic/tclUnicodeObj.c b/generic/tclUnicodeObj.c index 315644d..1809b20 100644 --- a/generic/tclUnicodeObj.c +++ b/generic/tclUnicodeObj.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: tclUnicodeObj.c,v 1.5 1999/06/10 04:28:51 stanton Exp $ + * RCS: @(#) $Id: tclUnicodeObj.c,v 1.6 1999/06/10 19:14:54 hershey Exp $ */ #include <math.h> @@ -640,7 +640,7 @@ DupUnicodeInternalRep(srcPtr, copyPtr) Tcl_Obj *copyPtr; /* Object with internal rep to set. */ { Unicode *srcUnicodePtr = GET_UNICODE(srcPtr); - Unicode *copyUnicodePtr; /*GET_UNICODE(copyPtr);*/ + Unicode *copyUnicodePtr; /* * If the src obj is a string of 1-byte Utf chars, then copy the @@ -649,7 +649,7 @@ DupUnicodeInternalRep(srcPtr, copyPtr) * internal rep, and invalidate the string rep of the new object. */ - if (AllSingleByteChars(srcPtr)) { + if (srcUnicodePtr->numChars == srcPtr->length) { copyUnicodePtr = (Unicode *) ckalloc(sizeof(Unicode)); copyUnicodePtr->allocated = 0; } else { @@ -664,6 +664,7 @@ DupUnicodeInternalRep(srcPtr, copyPtr) } copyUnicodePtr->numChars = srcUnicodePtr->numChars; SET_UNICODE(copyPtr, copyUnicodePtr); + copyPtr->typePtr = &tclUnicodeType; } /* |