c/experimental/dynamic/strdup

Returns a pointer to a null-terminated byte string, which is a duplicate of the string pointed to by. The returned pointer must be passed to free to avoid a memory leak.

If an error occurs, a null pointer is returned and errno may be set.

Return value
A pointer to the newly allocated string, or a null pointer if an error occurred.