XMALLOC
tmp = XMALLOC((len + 1) * sizeof(wchar_t));
output_buffer = XMALLOC((max_length+1) * sizeof(wchar_t));
if (buf==NULL) { length=100; buf=XMALLOC(length * sizeof(wchar_t)); }