rem: buf = Ns_TlsGet(&buftls);
add: if (tls == NULL) { Ns_MasterLock(); if (tls == NULL) { Ns_TlsAlloc(&tls, ns_free); } Ns_MasterUnlock(); } buf = Ns_TlsGet(&tls);
context: NsGetBuf(char **bufPtr, int *sizePtr){    char *buf;    buf = Ns_TlsGet(&buftls);    if (buf == NULL) {	buf = ns_malloc(nsconf.bufsize);	Ns_TlsSet(&buftls, buf);    }     *bufPtr = buf;    *sizePtr = nsconf.bufsize;}