rem: tPtr->text = realloc(tPtr->text, tPtr->bufferSize);
add: tPtr->text = wrealloc(tPtr->text, tPtr->bufferSize);
context: WMInsertTextFieldText(WMTextField *tPtr, char *text, int position){    int len;     CHECK_CLASS(tPtr, WC_TextField);        if (!text)	return;        len = strlen(text);    /* check if buffer will hold the text */    if (len + tPtr->textLen >= tPtr->bufferSize) {	tPtr->bufferSize = tPtr->textLen + len + TEXT_BUFFER_INCR;	tPtr->text = realloc(tPtr->text, tPtr->bufferSize);    }        if (position < 0 || position >= tPtr->textLen) {	/* append the text at the end */	strcat(tPtr->text, text);		incrToFit(tPtr);	tPtr->textLen += len;	tPtr->cursorPosition += len;    } else {	/* insert text at position */ 	memmv(&(tPtr->text[position+len]), &(tPtr->text[position]),                tPtr->textLen-position+1);	memcpy(&(tPtr->text[position]), text, len);	tPtr->textLen += len;	if (position >= tPtr->cursorPosition) {	    tPtr->cursorPosition += len;	    incrToFit2(tPtr);	} else {	    incrToFit(tPtr);	}    }    paintTextField(tPtr);}