This is in line with ‘talloc_str[n]dup()’.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
uint16_t *talloc_utf16_strdup(TALLOC_CTX *mem_ctx, const char *str)
{
+ if (str == NULL) {
+ return NULL;
+ }
return talloc_utf16_strlendup(mem_ctx, str, utf16_len(str));
}
uint16_t *talloc_utf16_strndup(TALLOC_CTX *mem_ctx, const char *str, size_t n)
{
+ if (str == NULL) {
+ return NULL;
+ }
return talloc_utf16_strlendup(mem_ctx, str, utf16_len_n(str, n));
}