Home

Traffic Server Software Developers Kit

INKstrdup

Returns a pointer to a duplicate string.

Prototype

char* INKstrdup (const char *str)

Arguments

str is a pointer to the null-terminated string to duplicate.

Description

Returns a pointer to a new string that's a duplicate of the string pointed to by str. The memory for the new string is allocated using INKmalloc and should be freed by a call to INKfree.

Returns

A pointer to the duplicated string.

[Note] Note

A valid null-terminated string may not be returned if the input str argument is not a valid pointer (i.e. a NULL argument would simply cause INKstrdup to return NULL).