summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhershey <hershey>1999-06-10 19:14:54 (GMT)
committerhershey <hershey>1999-06-10 19:14:54 (GMT)
commita1bbc1ac05acbe4053d7f8fab4555437acbc9c5c (patch)
tree0936338ce74c43e4f554ffe9610b9e8976c2f7c5 /generic
parent7d849078f78a84680ee3d12ee9146dbfc4aaf54b (diff)
downloadtcl-a1bbc1ac05acbe4053d7f8fab4555437acbc9c5c.zip
tcl-a1bbc1ac05acbe4053d7f8fab4555437acbc9c5c.tar.gz
tcl-a1bbc1ac05acbe4053d7f8fab4555437acbc9c5c.tar.bz2
fied a memory leak. purify nolonger complains.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclUnicodeObj.c7
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;
}
/*