Index: generic/nsfInt.h =================================================================== diff -u -N -r878a74b68b15d4ee5c33d345e670f50ce7473ebc -r84a4722d451c6724abd6e51bfb6d1abdeb61e2ff --- generic/nsfInt.h (.../nsfInt.h) (revision 878a74b68b15d4ee5c33d345e670f50ce7473ebc) +++ generic/nsfInt.h (.../nsfInt.h) (revision 84a4722d451c6724abd6e51bfb6d1abdeb61e2ff) @@ -179,7 +179,7 @@ # define MEM_COUNT_RELEASE() #endif -# define STRING_NEW(target, p, l) (target) = strndup(p,l); MEM_COUNT_ALLOC(#target, (target)) +# define STRING_NEW(target, p, l) {char *tempValue = ckalloc((unsigned)(l)+1u); strncpy((tempValue), (p), (l)); *((tempValue)+(l)) = '\0'; target = tempValue; MEM_COUNT_ALLOC(#target, (target))} # define STRING_FREE(key, p) MEM_COUNT_FREE((key), (p)); ckfree((p)) #define DSTRING_INIT(dsPtr) Tcl_DStringInit(dsPtr); MEM_COUNT_ALLOC("DString",(dsPtr))