summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhershey <hershey@noemail.net>1999-06-10 19:14:54 (GMT)
committerhershey <hershey@noemail.net>1999-06-10 19:14:54 (GMT)
commitd9c60b3440f20c4986512539e1ab0226233374ab (patch)
tree0936338ce74c43e4f554ffe9610b9e8976c2f7c5 /generic
parentfbebefdb316dcef0a9d79d46963c397d93bbe496 (diff)
downloadtcl-d9c60b3440f20c4986512539e1ab0226233374ab.zip
tcl-d9c60b3440f20c4986512539e1ab0226233374ab.tar.gz
tcl-d9c60b3440f20c4986512539e1ab0226233374ab.tar.bz2
fied a memory leak. purify nolonger complains.
FossilOrigin-Name: 9726b2f18e773fcdcef709f34834492790301d43
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;
}
/*