XMALLOC
tmp = XMALLOC((len + 1) * sizeof(wchar_t));
output_buffer = XMALLOC((max_length + 1) * sizeof(wchar_t));
buf = XMALLOC(length * sizeof(wchar_t));