The wcsdup() function is the wide-character equivalent of strdup(). The wcsdup() function shall return a pointer to a new wide character string, which is a duplicate of the wide character string pointed to by s. The returned pointer can be passed to free(). A null pointer is returned if the new string cannot be created.
The wcsdup() function returns a pointer to a new wide-character
string on success. Otherwise, it shall return NULL and set
errno to indicate the error.